[uClinux-dev] Sporadic hang on opening /dev/console

Wolf, Josef josef.wolf at siemens.com
Tue Oct 16 08:20:50 EDT 2007


Hello,

I use uClinuc-dist-20051014 with linux-2.4.32 on a lpc2492 (this is an
arm7tdmi from NXP).  Most of the time, everything works as expected.
But sometimes, the boot hangs when init/main.c tries to open
/dev/console
(this is a serial console on the internal UART of the lpc2492).  When I
enter a character on the console, the boot continues.  It looks like
some
sort of race condition, since it is not exactly reproducable.

I have tried to debug.  Here is what I have found out so far.

init/main.c   calls fs/devices.c:chrdev_open()
chrdev_open() calls drivers/char/tty_io.c:tty_open()
tty_open()    calls drivers/char/serial.c/rs_open()
rs_open()     calls drivers/char/serial.c/startup()
in startup(), right after the change_speed() call and before before the
"errout:"
              label at the end of the function, the invocation of the
              restore_flags(flags) macro hangs.

The restore_flags() macro appears to be the __restore_flags() from
include/asm-armnommu/proc_armv/system.h which appears to look like this:

   /*
    * restore saved IRQ & FIQ state
    */
   #define __restore_flags(x)                      \
           __asm__ __volatile__(                   \
           "msr  cpsr_c, %0     @ restore_flags\n" \
           :                                       \
           : "r" (x)                               \
           : "memory");

I am really stuck now.

Any ideas why this restore_flags() macro hangs sometimes and how it
comes to
continue when a character is input on the console?


More information about the uClinux-dev mailing list