aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/8250.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-07-03 09:30:01 -0400
committerThomas Gleixner <tglx@linutronix.de>2009-07-29 17:30:37 -0400
commit295048108ae1c03ede2297c08133526c5a1b6b3b (patch)
tree48744bec1f51f4e2b44bb0963e48cbd3ad66cc9f /drivers/serial/8250.c
parent99c5059eca9de458b1ccd5e1e929d6f27ea56d12 (diff)
drivers/serial: Clean up the locking for -rt
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/serial/8250.c')
-rw-r--r--drivers/serial/8250.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index fb867a9f55e9..a1f403ec9213 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2729,14 +2729,10 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
2729 2729
2730 touch_nmi_watchdog(); 2730 touch_nmi_watchdog();
2731 2731
2732 local_irq_save(flags); 2732 if (up->port.sysrq || oops_in_progress)
2733 if (up->port.sysrq) { 2733 locked = spin_trylock_irqsave(&up->port.lock, flags);
2734 /* serial8250_handle_port() already took the lock */ 2734 else
2735 locked = 0; 2735 spin_lock_irqsave(&up->port.lock, flags);
2736 } else if (oops_in_progress) {
2737 locked = spin_trylock(&up->port.lock);
2738 } else
2739 spin_lock(&up->port.lock);
2740 2736
2741 /* 2737 /*
2742 * First save the IER then disable the interrupts 2738 * First save the IER then disable the interrupts
@@ -2768,8 +2764,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
2768 check_modem_status(up); 2764 check_modem_status(up);
2769 2765
2770 if (locked) 2766 if (locked)
2771 spin_unlock(&up->port.lock); 2767 spin_unlock_irqrestore(&up->port.lock, flags);
2772 local_irq_restore(flags);
2773} 2768}
2774 2769
2775static int __init serial8250_console_setup(struct console *co, char *options) 2770static int __init serial8250_console_setup(struct console *co, char *options)