linux/drivers/tty/serial
Mika Westerberg 33b1e6939f serial: mrst_max3110: initialize waitqueue earlier
The driver went to initialize its waitqueue at the start of the main
processing thread.  However, it is possible that this thread is not
scheduled on a CPU before the write function is called which leads to a
following error:

  BUG: spinlock bad magic on CPU#1, swapper/1
   lock: f5f3ebdc, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
  Pid: 1, comm: swapper Not tainted 3.0.0-rc2+ #67
  Call Trace:
   [<c1289663>] spin_bug+0xa3/0xf0
   [<c12897ad>] do_raw_spin_lock+0x7d/0x150
   [<c14963de>] _raw_spin_lock_irqsave+0x4e/0x60
   [<c102f2bb>] __wake_up+0x1b/0x50
   [<c12d3715>] serial_m3110_con_write+0x55/0x60
   [<c1041575>] __call_console_drivers+0x75/0x90
   [<c10415d9>] _call_console_drivers+0x49/0x80
   [<c1041baa>] console_unlock+0xca/0x1f0
   [<c10420ef>] vprintk+0x18f/0x4f0
   [<c14928a3>] printk+0x18/0x1a
   [<c1042730>] register_console+0x2e0/0x350
   [<c12d098e>] uart_add_one_port+0x33e/0x3d0
   [<c1485ba6>] serial_m3110_probe+0x1c2/0x1df
   [<c1303db7>] spi_drv_probe+0x17/0x20
   ...

Fix this by initializing the waitqueue before the main thread is
created.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-06-23 08:54:10 -07:00
..
cpm_uart tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
jsm Fix common misspellings 2011-03-31 11:26:23 -03:00
8250_accent.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
8250_acorn.c
8250_boca.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
8250_early.c
8250_exar_st16c554.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
8250_fourport.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
8250_gsc.c
8250_hp300.c
8250_hub6.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
8250_mca.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
8250_pci.c serial: 8250_pci: add support for Cronyx Omega PCI multiserial board. 2011-05-19 16:51:02 -07:00
8250_pnp.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
8250.c tty/serial: Fix break handling for PORT_TEGRA 2011-05-19 16:51:02 -07:00
8250.h tty/serial: Add explicit PORT_TEGRA type 2011-05-19 16:51:01 -07:00
21285.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
68328serial.c arch, mm: filter disallowed nodes from arch specific show_mem functions 2011-05-25 08:39:03 -07:00
68328serial.h
68360serial.c Merge 2.6.38-rc6 into tty-next 2011-02-24 11:36:31 -08:00
altera_jtaguart.c Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6 2011-03-16 17:28:10 -07:00
altera_uart.c serial: altera_uart: Scan for a free port if platform device id is -1 2011-04-19 16:31:19 -07:00
amba-pl010.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
amba-pl011.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
apbuart.c sparc32,leon: Fixed APBUART frequency detection 2011-03-30 04:28:54 -07:00
apbuart.h
atmel_serial.c atmel_serial: keep the platform_device unchanged 2011-05-25 23:04:33 +08:00
bcm63xx_uart.c
bfin_5xx.c
bfin_sport_uart.c treewide: cleanup continuations and remove logging message whitespace 2011-04-26 10:24:37 +02:00
bfin_sport_uart.h
clps711x.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
crisv10.c tty: now phase out the ioctl file pointer for good 2011-02-17 11:59:56 -08:00
crisv10.h
dz.c
dz.h
icom.c Fix common misspellings 2011-03-31 11:26:23 -03:00
icom.h
ifx6x60.c Serial: ifx6x60c: Remove duplicate includes of linux/tty.h 2011-04-19 16:33:37 -07:00
ifx6x60.h
imx.c Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 2011-05-23 12:23:20 -07:00
ioc3_serial.c
ioc4_serial.c
ip22zilog.c Fix common misspellings 2011-03-31 11:26:23 -03:00
ip22zilog.h
Kconfig Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 2011-05-23 12:23:20 -07:00
kgdboc.c kgdboc,kgdbts: strlen() doesn't count the terminator 2011-03-25 16:37:30 -05:00
lantiq.c SERIAL: Lantiq: Add driver for MIPS Lantiq SOCs. 2011-05-19 09:55:43 +01:00
m32r_sio_reg.h
m32r_sio.c m32r: fix spin_lock_irqsave() misuse 2011-05-26 17:12:33 -07:00
m32r_sio.h
Makefile Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 2011-05-23 12:23:20 -07:00
max3100.c
max3107-aava.c
max3107.c
max3107.h Fix common misspellings 2011-03-31 11:26:23 -03:00
mcf.c
mfd.c treewide: cleanup continuations and remove logging message whitespace 2011-04-26 10:24:37 +02:00
mpc52xx_uart.c dt/serial: Eliminate users of of_platform_{,un}register_driver 2011-02-28 13:22:46 -07:00
mpsc.c
mrst_max3110.c serial: mrst_max3110: initialize waitqueue earlier 2011-06-23 08:54:10 -07:00
mrst_max3110.h Fix common misspellings 2011-03-31 11:26:23 -03:00
msm_serial_hs.c Fix common misspellings 2011-03-31 11:26:23 -03:00
msm_serial.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
msm_serial.h tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
msm_smd_tty.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
mux.c
mxs-auart.c
netx-serial.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
nwpserial.c
of_serial.c drivercore: revert addition of of_match to struct device 2011-05-18 12:32:23 -06:00
omap-serial.c Fix common misspellings 2011-03-31 11:26:23 -03:00
pch_uart.c drivers/tty/serial/pch_uart.c: don't oops if dmi_get_system_info returns NULL 2011-06-15 20:04:02 -07:00
pmac_zilog.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
pmac_zilog.h
pnx8xxx_uart.c
pxa.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
s3c24a0.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
s3c2400.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
s3c2410.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
s3c2412.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
s3c2440.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
s3c6400.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
s5pv210.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
sa1100.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
samsung.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
samsung.h tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
sb1250-duart.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
sc26xx.c
serial_core.c TTY: serial_core, remove superfluous set_task_state 2011-04-25 14:19:12 -07:00
serial_cs.c pcmcia: Convert pcmcia_device_id declarations to const 2011-05-06 07:46:22 +02:00
serial_ks8695.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
serial_txx9.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
sh-sci.c Merge branch 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 2011-05-23 21:24:07 -07:00
sh-sci.h sh: sh-sci: sh7377 and sh73a0 build fixes 2011-05-23 12:41:37 +09:00
sn_console.c Fix common misspellings 2011-03-31 11:26:23 -03:00
suncore.c
suncore.h
sunhv.c dt/serial: Eliminate users of of_platform_{,un}register_driver 2011-02-28 13:22:46 -07:00
sunsab.c dt/serial: Eliminate users of of_platform_{,un}register_driver 2011-02-28 13:22:46 -07:00
sunsab.h
sunsu.c dt/serial: Eliminate users of of_platform_{,un}register_driver 2011-02-28 13:22:46 -07:00
sunzilog.c Fix common misspellings 2011-03-31 11:26:23 -03:00
sunzilog.h
timbuart.c
timbuart.h
uartlite.c dt: uartlite: merge platform and of_platform driver bindings 2011-02-28 13:22:43 -07:00
ucc_uart.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2011-03-18 06:31:43 -07:00
vr41xx_siu.c
vt8500_serial.c tty: remove invalid location line in file header 2011-04-19 16:33:36 -07:00
xilinx_uartps.c tty/serial: add support for Xilinx PS UART 2011-05-03 10:26:39 -07:00
zs.c
zs.h