summaryrefslogtreecommitdiffstats
path: root/drivers/serial/8250.c
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@googlemail.com>2008-07-30 07:33:32 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-30 18:41:45 +0200
commitc389d27b5e643d745f55ffb939b1426060ba63d4 (patch)
treeaa7a4903fe58542a716a78e37d518d71727f9475 /drivers/serial/8250.c
parentmarkers: fix markers read barrier for multiple probes (diff)
downloadlinux-c389d27b5e643d745f55ffb939b1426060ba63d4.tar.xz
linux-c389d27b5e643d745f55ffb939b1426060ba63d4.zip
8250.c: port.lock is irq-safe
serial8250_startup() doesn't disable interrupts while taking the &up->port.lock which might race against the interrupt handler serial8250_interrupt(), which when entered, will deadlock waiting for the lock to be released. Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Tested-by: Ingo Molnar <mingo@elte.hu> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r--drivers/serial/8250.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index a97f1ae11f78..342e12fb1c25 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -1885,7 +1885,7 @@ static int serial8250_startup(struct uart_port *port)
* the interrupt is enabled. Delays are necessary to
* allow register changes to become visible.
*/
- spin_lock(&up->port.lock);
+ spin_lock_irqsave(&up->port.lock, flags);
if (up->port.flags & UPF_SHARE_IRQ)
disable_irq_nosync(up->port.irq);
@@ -1901,7 +1901,7 @@ static int serial8250_startup(struct uart_port *port)
if (up->port.flags & UPF_SHARE_IRQ)
enable_irq(up->port.irq);
- spin_unlock(&up->port.lock);
+ spin_unlock_irqrestore(&up->port.lock, flags);
/*
* If the interrupt is not reasserted, setup a timer to