Skip to content

Commit 6e01f9a

Browse files
jhovoldgregkh
authored andcommitted
serial: 8250_fsl: fix handle_irq locking
The 8250 handle_irq callback is not just called from the interrupt handler but also from a timer callback when polling (e.g. for ports without an interrupt line). Consequently the callback must explicitly disable interrupts to avoid a potential deadlock with another interrupt in polled mode. Fix up the two paths in the freescale callback that failed to re-enable interrupts when polling. Fixes: 853a9ae ("serial: 8250: fix handle_irq locking") Cc: [email protected] # 5.13 Reported-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/Y/xYzqp4ogmOF5t0@kili Signed-off-by: Johan Hovold <[email protected]> Acked-by: Jiri Slaby <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 32e293b commit 6e01f9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/tty/serial/8250/8250_fsl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ int fsl8250_handle_irq(struct uart_port *port)
3434

3535
iir = port->serial_in(port, UART_IIR);
3636
if (iir & UART_IIR_NO_INT) {
37-
spin_unlock(&up->port.lock);
37+
spin_unlock_irqrestore(&up->port.lock, flags);
3838
return 0;
3939
}
4040

4141
/* This is the WAR; if last event was BRK, then read and return */
4242
if (unlikely(up->lsr_saved_flags & UART_LSR_BI)) {
4343
up->lsr_saved_flags &= ~UART_LSR_BI;
4444
port->serial_in(port, UART_RX);
45-
spin_unlock(&up->port.lock);
45+
spin_unlock_irqrestore(&up->port.lock, flags);
4646
return 1;
4747
}
4848

0 commit comments

Comments
 (0)