mirror of
https://github.com/torvalds/linux.git
synced 2026-11-29 10:07:52 +00:00
serial: 8250_dw: Use serial_lsr_in() in dw8250_handle_irq()
dw8250_handle_irq() reads LSR under a few conditions, convert both to use serial_lsr_in() in order to preserve LSR flags properly across reads. Fixes:424d79183a("serial: 8250_dw: Avoid "too much work" from bogus rx timeout interrupt") Fixes:aa63d786ce("serial: 8250: dw: Add support for DMA flow controlling devices") Cc: Douglas Anderson <[email protected]> Cc: Phil Edworthy <[email protected]> Cc: Miquel Raynal <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7a3525e48c
commit
197eb5c416
@@ -253,7 +253,7 @@ static int dw8250_handle_irq(struct uart_port *p)
|
||||
*/
|
||||
if (!up->dma && rx_timeout) {
|
||||
spin_lock_irqsave(&p->lock, flags);
|
||||
status = p->serial_in(p, UART_LSR);
|
||||
status = serial_lsr_in(up);
|
||||
|
||||
if (!(status & (UART_LSR_DR | UART_LSR_BI)))
|
||||
(void) p->serial_in(p, UART_RX);
|
||||
@@ -263,7 +263,7 @@ static int dw8250_handle_irq(struct uart_port *p)
|
||||
|
||||
/* Manually stop the Rx DMA transfer when acting as flow controller */
|
||||
if (quirks & DW_UART_QUIRK_IS_DMA_FC && up->dma && up->dma->rx_running && rx_timeout) {
|
||||
status = p->serial_in(p, UART_LSR);
|
||||
status = serial_lsr_in(up);
|
||||
if (status & (UART_LSR_DR | UART_LSR_BI)) {
|
||||
dw8250_writel_ext(p, RZN1_UART_RDMACR, 0);
|
||||
dw8250_writel_ext(p, DW_UART_DMASA, 1);
|
||||
|
||||
Reference in New Issue
Block a user