diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-07-03 08:30:01 -0500 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2012-04-13 11:01:43 -0500 |
commit | b6179d412d8ab828ca6b9d5769cb0f2aba771230 (patch) | |
tree | 1b3f05882c00f0618d10afa1e470c0be4f5648b7 | |
parent | f6fcc4fe3f785e2d4421fffee56ebe3a9a47197f (diff) |
serial: 8250: Clean up the locking for -rt
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | drivers/tty/serial/8250/8250.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c index 5b149b466ec8..c93991503e2a 100644 --- a/drivers/tty/serial/8250/8250.c +++ b/drivers/tty/serial/8250/8250.c @@ -2807,14 +2807,10 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count) touch_nmi_watchdog(); - local_irq_save(flags); - if (port->sysrq) { - /* serial8250_handle_irq() already took the lock */ - locked = 0; - } else if (oops_in_progress) { - locked = spin_trylock(&port->lock); - } else - spin_lock(&port->lock); + if (port->sysrq || oops_in_progress) + locked = spin_trylock_irqsave(&port->lock, flags); + else + spin_lock_irqsave(&port->lock, flags); /* * First save the IER then disable the interrupts @@ -2846,8 +2842,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count) serial8250_modem_status(up); if (locked) - spin_unlock(&port->lock); - local_irq_restore(flags); + spin_unlock_irqrestore(&port->lock, flags); } static int __init serial8250_console_setup(struct console *co, char *options) |