imx27 - hanging at freeing init memory -- getting some junk characters here after on console ..

Martin Fuzzey mfuzzey at gmail.com
Fri Nov 27 03:49:27 EST 2009


Hi,
Please keep the list as copy.

On Thu, Nov 26, 2009 at 10:15 AM, Prabha J <prabha.j at tcs.com> wrote:
> Hi,
>
> 1. Another idea would be to patch drivers/serial/imx.c so that
> imx_set_termios() and imx_setup_ufcr() are NOPs; that should leave the
> UART config as the bootloader set it - which seems to work.
>
> [even though the bit time is correct maybe its a word format error...]
>
> I am using IMX27 processor based board(From iwave Rainbow G3 board).
> I am also facing same problem.
> As you have suggested i commented whole imx_set_termios() as
>
> static int imx_setup_ufcr(struct imx_port *sport, unsigned int mode)
> {
> #if 0
>         unsigned int val;
>         unsigned int ufcr_rfdiv;
>
>         /* set receiver / transmitter trigger level.
>          * RFDIV is set such way to satisfy requested uartclk value
>          */
>         val = TXTL << 10 | RXTL;
>         ufcr_rfdiv = (clk_get_rate(sport->clk) + sport->port.uartclk / 2)
>                         / sport->port.uartclk;
>
>         if(!ufcr_rfdiv)
>                 ufcr_rfdiv = 1;
>
>         if(ufcr_rfdiv >= 7)
>                 ufcr_rfdiv = 6;
>         else
>                 ufcr_rfdiv = 6 - ufcr_rfdiv;
>
>         val |= UFCR_RFDIV & (ufcr_rfdiv << 7);
>
>         writel(val, sport->port.membase + UFCR);
>
>         return 0;
> #endif
>         NOP();//prabha
> }
>
Not sure where NOP() comes from...

> and samething for imx_setup_ufcr() function.
>
> After this i am getting error as shown below.
> <3>BUG: soft lockup - CPU#0 stuck for 61s! [swapper:1]
> BUG: soft lockup - CPU#0 stuck for 61s! [swapper:1]
> Modules linked in:Modules linked in:
>
>
>
> Pid: 1, comm:              swapper
> Pid: 1, comm:              swapper
> CPU: 0    Not tainted  (2.6.27 #18)
> CPU: 0    Not tainted  (2.6.27 #18)
> PC is at handle_IRQ_event+0x2c/0x84
> PC is at handle_IRQ_event+0x2c/0x84
> LR is at handle_level_irq+0x94/0xec
> LR is at handle_level_irq+0x94/0xec
> pc : [<c0078920>]    lr : [<c007a294>]    psr: 40000013
> sp : c381dbf0  ip : c381dc10  fp : c381dc0c
> pc : [<c0078920>]    lr : [<c007a294>]    psr: 40000013
> sp : c381dbf0  ip : c381dc10  fp : c381dc0c
> r10: c3bd22e0  r9 : 00000000  r8 : 00000014
> r10: c3bd22e0  r9 : 00000000  r8 : 00000014
> r7 : 00000014  r6 : c381dce8  r5 : 00000014  r4 : c3bd22e0
> r7 : 00000014  r6 : c381dce8  r5 : 00000014  r4 : c3bd22e0
> r3 : 40000013  r2 : c044c8f8  r1 : c3bd22e0  r0 : 00000014
> r3 : 40000013  r2 : c044c8f8  r1 : c3bd22e0  r0 : 00000014
> Flags: nZcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
> Flags: nZcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
> Control: 0005317f  Table: a0004000  DAC: 00000017
> Control: 0005317f  Table: a0004000  DAC: 00000017
> [<c0029d40>] [<c0029d40>] (show_regs+0x0/0x50) (show_regs+0x0/0x50) from
> [<c0078450>] from [<c0078450>] (softlockup_tick+0x108/0x158)
> (softlockup_tick+0x108/0x158)
>  r4:026258eb r4:026258eb
>
> [<c0078348>] [<c0078348>] (softlockup_tick+0x0/0x158)
> (softlockup_tick+0x0/0x158) from [<c0051604>] from [<c0051604>]
> (run_local_timers+0x1c/0x20)
> (run_local_timers+0x1c/0x20)
> [<c00515e8>] [<c00515e8>] (run_local_timers+0x0/0x20)
> (run_local_timers+0x0/0x20) from [<c0051a90>] from [<c0051a90>]
> (update_process_times+0x2c/0x58)
> (update_process_times+0x2c/0x58)
> [<c0051a64>] [<c0051a64>] (update_process_times+0x0/0x58)
> (update_process_times+0x0/0x58) from [<c0065098>] from [<c0065098>]
> (tick_sched_timer+0x8c/0xd8)
> (tick_sched_timer+0x8c/0xd8)
>  r5:c381dba8 r5:c381dba8 r4:c046f298 r4:c046f298
>
> [<c006500c>] [<c006500c>] (tick_sched_timer+0x0/0xd8)
> (tick_sched_timer+0x0/0xd8) from [<c005ebb8>] from [<c005ebb8>]
> (__run_hrtimer+0x58/0xa4)
> (__run_hrtimer+0x58/0xa4)
>  r7:3fbce150 r7:3fbce150 r6:c046f298 r6:c046f298 r5:c0431ee8 r5:c0431ee8
> r4:c046f298 r4:c046f298
>
> [<c005eb60>] [<c005eb60>] (__run_hrtimer+0x0/0xa4) (__run_hrtimer+0x0/0xa4)
> from [<c005fbd8>] from [<c005fbd8>] (hrtimer_interrupt+0x168/0x214)
> (hrtimer_interrupt+0x168/0x214)
>  r5:00000044 r5:00000044 r4:04c4ca40 r4:04c4ca40
>
> [<c005fa70>] [<c005fa70>] (hrtimer_interrupt+0x0/0x214)
> (hrtimer_interrupt+0x0/0x214) from [<c0033320>] from [<c0033320>]
> (mxc_timer_interrupt+0x2c/0x3c)
> (mxc_timer_interrupt+0x2c/0x3c)
> [<c00332f4>] [<c00332f4>] (mxc_timer_interrupt+0x0/0x3c)
> (mxc_timer_interrupt+0x0/0x3c) from [<c0078938>] from [<c0078938>]
> (handle_IRQ_event+0x44/0x84)
> (handle_IRQ_event+0x44/0x84)
> [<c00788f4>] [<c00788f4>] (handle_IRQ_event+0x0/0x84)
> (handle_IRQ_event+0x0/0x84) from [<c007a294>] from [<c007a294>]
> (handle_level_irq+0x94/0xec)
> (handle_level_irq+0x94/0xec)
>  r7:00000014 r7:00000014 r6:c381dc48 r6:c381dc48 r5:0000001a r5:0000001a
> r4:c0433190 r4:c0433190
>
> [<c007a200>] [<c007a200>] (handle_level_irq+0x0/0xec)
> (handle_level_irq+0x0/0xec) from [<c0028048>] from [<c0028048>]
> (asm_do_IRQ+0x48/0x64)
> (asm_do_IRQ+0x48/0x64)
>  r5:c0433190 r5:c0433190 r4:0000001a r4:0000001a
>
> [<c0028000>] [<c0028000>] (asm_do_IRQ+0x0/0x64) (asm_do_IRQ+0x0/0x64) from
> [<c0338bb0>] from [<c0338bb0>] (__irq_svc+0x30/0x60)
> (__irq_svc+0x30/0x60)
> Exception stack(0xc381dba8 to 0xc381dbf0)
> Exception stack(0xc381dba8 to 0xc381dbf0)
> dba0: dba0:                                     00000014 00000014 c3bd22e0
> c3bd22e0 c044c8f8 c044c8f8 40000013 40000013 c3bd22e0 c3bd22e0 00000014
> 00000014
>
> dbc0: dbc0: c381dce8 c381dce8 00000014 00000014 00000014 00000014 00000000
> 00000000 c3bd22e0 c3bd22e0 c381dc0c c381dc0c c381dc10 c381dc10 c381dbf0
> c381dbf0
>
> dbe0: dbe0: c007a294 c007a294 c0078920 c0078920 40000013 40000013 ffffffff
> ffffffff
>
>  r6:001a0000 r6:001a0000 r5:f4040000 r5:f4040000 r4:ffffffff r4:ffffffff
>
> [<c00788f4>] [<c00788f4>] (handle_IRQ_event+0x0/0x84)
> (handle_IRQ_event+0x0/0x84) from [<c007a294>] from [<c007a294>]
> (handle_level_irq+0x94/0xec)
> (handle_level_irq+0x94/0xec)
>  r7:00000000 r7:00000000 r6:c381dce8 r6:c381dce8 r5:00000014 r5:00000014
> r4:c0433040 r4:c0433040
>
> [<c007a200>] [<c007a200>] (handle_level_irq+0x0/0xec)
> (handle_level_irq+0x0/0xec) from [<c0028048>] from [<c0028048>]
> (asm_do_IRQ+0x48/0x64)
> (asm_do_IRQ+0x48/0x64)
>  r5:c0433040 r5:c0433040 r4:00000014 r4:00000014
>
> [<c0028000>] [<c0028000>] (asm_do_IRQ+0x0/0x64) (asm_do_IRQ+0x0/0x64) from
> [<c0338bb0>] from [<c0338bb0>] (__irq_svc+0x30/0x60)
> (__irq_svc+0x30/0x60)
> Exception stack(0xc381dc48 to 0xc381dc90)
> Exception stack(0xc381dc48 to 0xc381dc90)
> dc40: dc40:                                     0000001a 0000001a c381c000
> c381c000 c046db40 c046db40 20000013 20000013 00000102 00000102 c0433190
> c0433190
>
> dc60: dc60: 0000000a 0000000a 00000000 00000000 00000014 00000014 00000000
> 00000000 c3bd22e0 c3bd22e0 c381dcac c381dcac c381dcb0 c381dcb0 c381dc90
> c381dc90
>
> dc80: dc80: c004cefc c004cefc c004cb8c c004cb8c 20000013 20000013 ffffffff
> ffffffff
>
>  r6:00140000 r6:00140000 r5:f4040000 r5:f4040000 r4:ffffffff r4:ffffffff
>
> [<c004cb44>] [<c004cb44>] (__do_softirq+0x0/0xd4) (__do_softirq+0x0/0xd4)
> from [<c004cefc>] from [<c004cefc>] (irq_exit+0x4c/0x84)
> (irq_exit+0x4c/0x84)
>  r6:00000000 r6:00000000 r5:c0433190 r5:c0433190 r4:c381c000 r4:c381c000
>
> [<c004ceb0>] [<c004ceb0>] (irq_exit+0x0/0x84) (irq_exit+0x0/0x84) from
> [<c002804c>] from [<c002804c>] (asm_do_IRQ+0x4c/0x64)
> (asm_do_IRQ+0x4c/0x64)
>  r4:0000001a r4:0000001a
>
> [<c0028000>] [<c0028000>] (asm_do_IRQ+0x0/0x64) (asm_do_IRQ+0x0/0x64) from
> [<c0338bb0>] from [<c0338bb0>] (__irq_svc+0x30/0x60)
> (__irq_svc+0x30/0x60)
> Exception stack(0xc381dce8 to 0xc381dd30)
> Exception stack(0xc381dce8 to 0xc381dd30)
> dce0: dce0:                                     00000000 00000000 c3bd22e0
> c3bd22e0 00000000 00000000 00000000 00000000 c0079820 c0079820 c0433040
> c0433040
>
> dd00: dd00: 40000013 40000013 00000000 00000000 00000014 00000014 00000000
> 00000000 c3bd22e0 c3bd22e0 c381dd64 c381dd64 c381dd08 c381dd08 c381dd30
> c381dd30
>
> dd20: dd20: c00797fc c00797fc c00791a0 c00791a0 60000013 60000013 ffffffff
> ffffffff
>
>  r6:001a0000 r6:001a0000 r5:f4040000 r5:f4040000 r4:ffffffff r4:ffffffff
>
> [<c0078fa0>] [<c0078fa0>] (setup_irq+0x0/0x28c) (setup_irq+0x0/0x28c) from
> [<c00792f8>] from [<c00792f8>] (request_irq+0xcc/0xf8)
> (request_irq+0xcc/0xf8)
> [<c007922c>] [<c007922c>] (request_irq+0x0/0xf8) (request_irq+0x0/0xf8) from
> [<c0238f50>] from [<c0238f50>] (imx_startup+0xb8/0x184)
> (imx_startup+0xb8/0x184)
> [<c0238e98>] [<c0238e98>] (imx_startup+0x0/0x184) (imx_startup+0x0/0x184)
> from [<c02360c8>] from [<c02360c8>] (uart_startup+0x90/0x194)
> (uart_startup+0x90/0x194)
>  r5:c3b9a800 r5:c3b9a800 r4:00000000 r4:00000000
>
> [<c0236038>] [<c0236038>] (uart_startup+0x0/0x194) (uart_startup+0x0/0x194)
> from [<c0237ecc>] from [<c0237ecc>] (uart_open+0x184/0x45c)
> (uart_open+0x184/0x45c)
> [<c0237d48>] [<c0237d48>] (uart_open+0x0/0x45c) (uart_open+0x0/0x45c) from
> [<c02211b4>] from [<c02211b4>] (tty_open+0x188/0x2e0)
> (tty_open+0x188/0x2e0)
> [<c022102c>] [<c022102c>] (tty_open+0x0/0x2e0) (tty_open+0x0/0x2e0) from
> [<c00a9834>] from [<c00a9834>] (chrdev_open+0x120/0x164)
> (chrdev_open+0x120/0x164)
> [<c00a9714>] [<c00a9714>] (chrdev_open+0x0/0x164) (chrdev_open+0x0/0x164)
> from [<c00a4d60>] from [<c00a4d60>] (__dentry_open+0x158/0x274)
> (__dentry_open+0x158/0x274)
>  r7:c00a9714 r7:c00a9714 r6:00000000 r6:00000000 r5:c342c410 r5:c342c410
> r4:c3b715a0 r4:c3b715a0
>
> [<c00a4c08>] [<c00a4c08>] (__dentry_open+0x0/0x274)
> (__dentry_open+0x0/0x274) from [<c00a4eb4>] from [<c00a4eb4>]
> (nameidata_to_filp+0x38/0x50)
> (nameidata_to_filp+0x38/0x50)
> [<c00a4e7c>] [<c00a4e7c>] (nameidata_to_filp+0x0/0x50)
> (nameidata_to_filp+0x0/0x50) from [<c00b2164>] from [<c00b2164>]
> (do_filp_open+0x354/0x6e0)
> (do_filp_open+0x354/0x6e0)
>  r4:00000000 r4:00000000
>
> [<c00b1e10>] [<c00b1e10>] (do_filp_open+0x0/0x6e0) (do_filp_open+0x0/0x6e0)
> from [<c00a4b1c>] from [<c00a4b1c>] (do_sys_open+0x5c/0xec)
> (do_sys_open+0x5c/0xec)
> [<c00a4ac0>] [<c00a4ac0>] (do_sys_open+0x0/0xec) (do_sys_open+0x0/0xec) from
> [<c00a4be4>] from [<c00a4be4>] (sys_open+0x24/0x28)
> (sys_open+0x24/0x28)
>  r8:00000000 r8:00000000 r7:00000000 r7:00000000 r6:00000000 r6:00000000
> r5:c0021fd0 r5:c0021fd0 r4:c044bcf8 r4:c044bcf8
>
> [<c00a4bc0>] [<c00a4bc0>] (sys_open+0x0/0x28) (sys_open+0x0/0x28) from
> [<c0028444>] from [<c0028444>] (init_post+0x30/0x104)
> (init_post+0x30/0x104)
> [<c0028414>] [<c0028414>] (init_post+0x0/0x104) (init_post+0x0/0x104) from
> [<c000893c>] from [<c000893c>] (kernel_init+0xb4/0xd8)
> (kernel_init+0xb4/0xd8)
>  r4:c044bcf8 r4:c044bcf8
>
> [<c0008888>] [<c0008888>] (kernel_init+0x0/0xd8) (kernel_init+0x0/0xd8) from
> [<c004ab48>] from [<c004ab48>] (do_exit+0x0/0x798)
> (do_exit+0x0/0x798)
>  r5:00000000 r5:00000000 r4:00000000 r4:00000000
>
>
>
Are you getting any extra output (that you didn't have before patching
the serial driver)?
Ie it could be that you were always getting this lockup just at the
wrong baud rate so you couldn't see it.

Please try the following patch instead:
And look for the @HACK@ output.
That should show if someone else is trying to set the serial port wrongly.


diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index 18130f1..0bf841e 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -573,6 +573,7 @@ static int imx_setup_ufcr(struct imx_port *sport,
unsigned int mode)
        unsigned int val;
        unsigned int ufcr_rfdiv;

+#if 0
        /* set receiver / transmitter trigger level.
         * RFDIV is set such way to satisfy requested uartclk value
         */
@@ -586,7 +587,9 @@ static int imx_setup_ufcr(struct imx_port *sport,
unsigned int mode)
        val |= UFCR_RFDIV_REG(ufcr_rfdiv);

        writel(val, sport->port.membase + UFCR);
-
+#else
+       printk(KERN_INFO "@HACK@ ignoring imx_setup_ufcr %d\n",
sport->port.line);
+#endif
        return 0;
 }

@@ -789,6 +792,7 @@ imx_set_termios(struct uart_port *port, struct
ktermios *termios,
        unsigned long num, denom;
        uint64_t tdiv64;

+#if 0
        /*
         * If we don't support modem control lines, don't allow
         * these to be set.
@@ -931,6 +935,13 @@ imx_set_termios(struct uart_port *port, struct
ktermios *termios,
                imx_enable_ms(&sport->port);

        spin_unlock_irqrestore(&sport->port.lock, flags);
+#else
+       printk(KERN_INFO "@HACK@ ignoring imx_set_termios %d baud=%d
flags=%X\n",
+               sport->port.line,
+               uart_get_baud_rate(port, termios, old, 50, port->uartclk / 16),
+               termios->c_cflag);
+#endif
+
 }

 static const char *imx_type(struct uart_port *port)



More information about the linux-arm mailing list