[ARM] 4417/1: Serial: Fix AMBA drivers locking
authorThomas Gleixner <tglx@linutronix.de>
Tue, 29 May 2007 20:53:50 +0000 (21:53 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 30 May 2007 13:33:01 +0000 (14:33 +0100)
The -rt patch triggered a lockdep warning in the amba serial drivers, which never
shows up on UP kernels. On SMP systems this would trigger as well.

Release the port lock before calling tty_flip_buffer_push() and reacquire it after
the call. This matches the code in the 8250 serial driver.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/serial/amba-pl010.c
drivers/serial/amba-pl011.c

index 1a9a24b82636e42704ae910f97e46d212800ebd4..00d1255e4c12026cd3ff7104e3861e217a0649fe 100644 (file)
@@ -167,8 +167,9 @@ static void pl010_rx_chars(struct uart_amba_port *uap)
        ignore_char:
                status = readb(uap->port.membase + UART01x_FR);
        }
+       spin_unlock(&port->lock);
        tty_flip_buffer_push(tty);
-       return;
+       spin_lock(&port->lock);
 }
 
 static void pl010_tx_chars(struct uart_amba_port *uap)
index 44639e71372a7eb08c209562e95374fe5d0fb22e..954073c6ce3a4e5cccb7df1806575fc1778cbc2c 100644 (file)
@@ -153,8 +153,9 @@ static void pl011_rx_chars(struct uart_amba_port *uap)
        ignore_char:
                status = readw(uap->port.membase + UART01x_FR);
        }
+       spin_unlock(&uap->port.lock);
        tty_flip_buffer_push(tty);
-       return;
+       spin_lock(&uap->port.lock);
 }
 
 static void pl011_tx_chars(struct uart_amba_port *uap)