linux/drivers/serial
Anton Vorontsov 768aec0b5b serial: 8250: fix shared interrupts issues with SMP and RT kernels
With SMP kernels _irqsave spinlock disables only local interrupts, while
the shared serial interrupt could be assigned to the CPU that is not
currently starting up the serial port.

This might cause issues because serial8250_startup() routine issues
IRQ-triggering operations before registering the port in the IRQ chain
(though, this is fine to do and done explicitly because we don't want to
process any interrupts on the port startup).

With RT kernels and preemptable hardirqs, _irqsave spinlock does not
disable local hardirqs, and the bug could be reproduced much easily:

$ cat /dev/ttyS0 &
$ cat /dev/ttyS1
irq 42: nobody cared (try booting with the "irqpoll" option)
Call Trace:
[C0475EB0] [C0008A98] show_stack+0x4c/0x1ac (unreliable)
[C0475EF0] [C004BBD4] __report_bad_irq+0x34/0xb8
[C0475F10] [C004BD38] note_interrupt+0xe0/0x308
[C0475F50] [C004B09C] thread_simple_irq+0xdc/0x104
[C0475F70] [C004B3FC] do_irqd+0x338/0x3c8
[C0475FC0] [C00398E0] kthread+0xf8/0x100
[C0475FF0] [C0011FE0] original_kernel_thread+0x44/0x60
handlers:
[<c02112c4>] (serial8250_interrupt+0x0/0x138)
Disabling IRQ #42

After this, all serial ports on the given IRQ are non-functional.

To fix the issue we should explicitly disable shared IRQ before
issuing any IRQ-triggering operations.

I also changed spin_lock_irqsave to the ordinary spin_lock, since it
seems to be safe: chain does not contain new port (yet), thus nobody
will interfere us from the ISRs.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-22 13:03:28 -07:00
..
cpm_uart cpm_uart: Support uart_wait_until_sent() 2008-07-14 07:55:38 -05:00
jsm serial: use tty_port 2008-07-20 17:12:35 -07:00
8250.c serial: 8250: fix shared interrupts issues with SMP and RT kernels 2008-07-22 13:03:28 -07:00
8250.h drivers/serial/: remove CVS keywords 2008-07-20 17:12:35 -07:00
8250_accent.c [SERIAL] Use an enum for serial8250 platform device IDs 2005-09-08 16:04:41 +01:00
8250_acorn.c [ARM] ecard: add ecardm_iomap() / ecardm_iounmap() 2007-05-11 17:19:02 +01:00
8250_boca.c [SERIAL] Use an enum for serial8250 platform device IDs 2005-09-08 16:04:41 +01:00
8250_early.c 8250: switch 8250 drivers to use _nocache ioremaps 2008-05-01 08:04:00 -07:00
8250_exar_st16c554.c [PATCH] Exar quad port serial 2006-12-07 08:39:35 -08:00
8250_fourport.c [SERIAL] Use an enum for serial8250 platform device IDs 2005-09-08 16:04:41 +01:00
8250_gsc.c 8250_gsc: coding style 2008-02-08 09:22:25 -08:00
8250_hp300.c 8250_hp300: coding style 2008-02-08 09:22:25 -08:00
8250_hub6.c 8250_hub6: codding style 2008-02-08 09:22:25 -08:00
8250_mca.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
8250_pci.c drivers/serial/: remove CVS keywords 2008-07-20 17:12:35 -07:00
8250_pnp.c drivers/serial/: remove CVS keywords 2008-07-20 17:12:35 -07:00
21285.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
68328serial.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
68328serial.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
68360serial.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
Kconfig drivers/serial/: remove CVS keywords 2008-07-20 17:12:35 -07:00
Makefile drivers/serial/: remove CVS keywords 2008-07-20 17:12:35 -07:00
amba-pl010.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
amba-pl011.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
atmel_serial.c atmel_serial: Fix tty_port breakage 2008-07-20 17:12:37 -07:00
bfin_5xx.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
bfin_sport_uart.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
bfin_sport_uart.h Blackfin serial driver: this driver enable SPORTs on Blackfin emulate UART 2008-04-30 08:29:30 -07:00
clps711x.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
crisv10.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
crisv10.h CRISv10 serial driver rewrite 2007-11-14 18:45:46 -08:00
dz.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
dz.h dz: clean up and improve the setup of termios settings 2008-02-07 08:42:24 -08:00
icom.c ttydev: Fix up compile failures in the PPC build 2008-07-22 13:03:22 -07:00
icom.h Coding style fix drivers/serial/icom.h 2008-02-03 14:47:38 +02:00
imx.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
ioc3_serial.c - Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
ioc4_serial.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
ip22zilog.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
ip22zilog.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
kgdboc.c tty: The big operations rework 2008-04-30 08:29:47 -07:00
m32r_sio.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
m32r_sio.h m32r: serial: remove M32R_SIO_SHARE_IRQS 2007-10-16 09:43:04 -07:00
m32r_sio_reg.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
mcf.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
mcfserial.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
mcfserial.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
mpc52xx_uart.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
mpsc.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
mux.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
netx-serial.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
of_serial.c of_serial: Use linux/of_platform.h instead of asm 2008-06-09 13:46:37 +10:00
pmac_zilog.c ttydev: fix pamc_zilog for tty pointer move 2008-07-20 17:12:36 -07:00
pmac_zilog.h [PATCH] tty: switch to ktermios 2006-12-08 08:28:57 -08:00
pnx8xxx_uart.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
pxa.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
s3c2400.c [ARM] S3C24XX: Split serial driver into core and per-cpu drivers 2008-07-03 16:51:31 +01:00
s3c2410.c [ARM] S3C24XX: Split serial driver into core and per-cpu drivers 2008-07-03 16:51:31 +01:00
s3c2412.c [ARM] S3C24XX: Split serial driver into core and per-cpu drivers 2008-07-03 16:51:31 +01:00
s3c2440.c [ARM] S3C24XX: Split serial driver into core and per-cpu drivers 2008-07-03 16:51:31 +01:00
sa1100.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
samsung.c [ARM] S3C24XX: Split serial driver into core and per-cpu drivers 2008-07-03 16:51:31 +01:00
samsung.h [ARM] S3C24XX: Split serial driver into core and per-cpu drivers 2008-07-03 16:51:31 +01:00
sb1250-duart.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
sc26xx.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
serial_core.c tty: rework break handling 2008-07-22 13:03:28 -07:00
serial_cs.c pcmcia: replace kio_addr_t with unsigned int everywhere 2008-02-05 09:44:08 -08:00
serial_ks8695.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
serial_lh7a40x.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
serial_txx9.c ttydev: Fix up compile failures in the PPC build 2008-07-22 13:03:22 -07:00
sh-sci.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
sh-sci.h sh-sci: avoid writing to nonexistent registers 2008-05-08 19:51:59 +09:00
sn_console.c - Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
suncore.c [SERIAL]: Fix section mismatches in Sun serial console drivers. 2007-12-29 01:19:49 -08:00
suncore.h [SERIAL] sparc: Infrastructure to fix section mismatch bugs. 2007-12-12 07:36:34 -08:00
sunhv.c ttydev: fix pamc_zilog for tty pointer move 2008-07-20 17:12:35 -07:00
sunsab.c ttydev: fix pamc_zilog for tty pointer move 2008-07-20 17:12:35 -07:00
sunsab.h [SUNSAB]: Defer register updates until transmitter is idle. 2005-05-11 11:34:32 -07:00
sunsu.c ttydev: fix pamc_zilog for tty pointer move 2008-07-20 17:12:35 -07:00
sunzilog.c ttydev: fix pamc_zilog for tty pointer move 2008-07-20 17:12:35 -07:00
sunzilog.h [SERIAL] sunzilog: Interrupt enable before ISR handler installed 2007-05-09 13:49:04 -07:00
uartlite.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
ucc_uart.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
v850e_uart.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
vr41xx_siu.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
zs.c Fix compile errors in SGI console drivers (linux-next tree) 2008-07-20 17:12:36 -07:00
zs.h zs: move to the serial subsystem 2007-07-18 08:38:22 -07:00