Skip to content

Commit 2389b27

Browse files
KAGA-KOKORussell King
authored and
Russell King
committed
[ARM] 4417/1: Serial: Fix AMBA drivers locking
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 <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 2ccdd1e commit 2389b27

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

drivers/serial/amba-pl010.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ static void pl010_rx_chars(struct uart_amba_port *uap)
167167
ignore_char:
168168
status = readb(uap->port.membase + UART01x_FR);
169169
}
170+
spin_unlock(&port->lock);
170171
tty_flip_buffer_push(tty);
171-
return;
172+
spin_lock(&port->lock);
172173
}
173174

174175
static void pl010_tx_chars(struct uart_amba_port *uap)

drivers/serial/amba-pl011.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,9 @@ static void pl011_rx_chars(struct uart_amba_port *uap)
153153
ignore_char:
154154
status = readw(uap->port.membase + UART01x_FR);
155155
}
156+
spin_unlock(&uap->port.lock);
156157
tty_flip_buffer_push(tty);
157-
return;
158+
spin_lock(&uap->port.lock);
158159
}
159160

160161
static void pl011_tx_chars(struct uart_amba_port *uap)

0 commit comments

Comments
 (0)