blob: 3a63633245c91fa5c52c0534a495bf1f14fda8d8 [file] [log] [blame]
From: Ingo Molnar <mingo@elte.hu>
Date: Fri, 3 Jul 2009 08:30:01 -0500
Subject: serial: 8250: Clean up the locking for -rt
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
drivers/tty/serial/8250/8250.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
Index: linux-stable/drivers/tty/serial/8250/8250.c
===================================================================
--- linux-stable.orig/drivers/tty/serial/8250/8250.c
+++ linux-stable/drivers/tty/serial/8250/8250.c
@@ -2773,14 +2773,10 @@ serial8250_console_write(struct console
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
@@ -2812,8 +2808,7 @@ serial8250_console_write(struct console
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)