diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-07-03 08:30:01 -0500 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2012-02-15 10:32:56 -0600 |
commit | 183f3e6a5a2babf9dd7405f3c1f64fc5596cb271 (patch) | |
tree | 520664647482b574d14a901dc17bdd5ffc061907 | |
parent | 24b246bd7f7cca5affa2bf5057979bb8b3bb43b0 (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.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c index eeadf1b8e093..43f7f4692b4f 100644 --- a/drivers/tty/serial/8250.c +++ b/drivers/tty/serial/8250.c @@ -2846,14 +2846,10 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count) touch_nmi_watchdog(); - local_irq_save(flags); - if (up->port.sysrq) { - /* serial8250_handle_port() already took the lock */ - locked = 0; - } else if (oops_in_progress) { - locked = spin_trylock(&up->port.lock); - } else - spin_lock(&up->port.lock); + if (up->port.sysrq || oops_in_progress) + locked = spin_trylock_irqsave(&up->port.lock, flags); + else + spin_lock_irqsave(&up->port.lock, flags); /* * First save the IER then disable the interrupts @@ -2885,8 +2881,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count) check_modem_status(up); if (locked) - spin_unlock(&up->port.lock); - local_irq_restore(flags); + spin_unlock_irqrestore(&up->port.lock, flags); } static int __init serial8250_console_setup(struct console *co, char *options) |