]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Backport patch-sysrq-deadlock until kernel is updated
authorTony Lindgren <tony@atomide.com>
Thu, 3 Aug 2006 10:43:54 +0000 (13:43 +0300)
committerTony Lindgren <tony@atomide.com>
Thu, 3 Aug 2006 10:43:54 +0000 (13:43 +0300)
Backport patch 68aa2c0d4a36b43ea9c6d77134c94b4501fd2eb4.
Without this patch sysrq does not work with 8250 serial console.

drivers/serial/8250.c

index 14c0fcd6af6e072f663608b92d7acc38f4eda8a8..5fb78cd004a40df50bb384757c24a8ed5fb29a87 100644 (file)
@@ -2271,10 +2271,14 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
 
        touch_nmi_watchdog();
 
-       if (oops_in_progress) {
-               locked = spin_trylock_irqsave(&up->port.lock, flags);
+       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_irqsave(&up->port.lock, flags);
+               spin_lock(&up->port.lock);
 
        /*
         *      First save the IER then disable the interrupts
@@ -2296,7 +2300,8 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
        serial_out(up, UART_IER, ier);
 
        if (locked)
-               spin_unlock_irqrestore(&up->port.lock, flags);
+               spin_unlock(&up->port.lock);
+       local_irq_restore(flags);
 }
 
 static int serial8250_console_setup(struct console *co, char *options)