summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2013-01-08 20:36:51 (GMT)
committerScott Wood <scottwood@freescale.com>2015-02-13 22:20:49 (GMT)
commit3bcac65ea0d47796c3d04af0d58a2a9a4f979680 (patch)
treed442b8a5c1a58230ec32cf50ced55f4c1be5ed4c /drivers/tty
parentfcb5a6267a49b97b97639a17592804517fd552d1 (diff)
downloadlinux-fsl-qoriq-3bcac65ea0d47796c3d04af0d58a2a9a4f979680.tar.xz
drivers-tty-pl011-irq-disable-madness.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/amba-pl011.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index a976ba9..0cc0f6f 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1916,13 +1916,19 @@ pl011_console_write(struct console *co, const char *s, unsigned int count)
clk_enable(uap->clk);
- local_irq_save(flags);
+ /*
+ * local_irq_save(flags);
+ *
+ * This local_irq_save() is nonsense. If we come in via sysrq
+ * handling then interrupts are already disabled. Aside of
+ * that the port.sysrq check is racy on SMP regardless.
+ */
if (uap->port.sysrq)
locked = 0;
else if (oops_in_progress)
- locked = spin_trylock(&uap->port.lock);
+ locked = spin_trylock_irqsave(&uap->port.lock, flags);
else
- spin_lock(&uap->port.lock);
+ spin_lock_irqsave(&uap->port.lock, flags);
/*
* First save the CR then disable the interrupts
@@ -1944,8 +1950,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count)
writew(old_cr, uap->port.membase + UART011_CR);
if (locked)
- spin_unlock(&uap->port.lock);
- local_irq_restore(flags);
+ spin_unlock_irqrestore(&uap->port.lock, flags);
clk_disable(uap->clk);
}