Skip to content

Commit 1980860

Browse files
ij-intelgregkh
authored andcommitted
serial: 8250: Flush DMA Rx on RLSI
Returning true from handle_rx_dma() without flushing DMA first creates a data ordering hazard. If DMA Rx has handled any character at the point when RLSI occurs, the non-DMA path handles any pending characters jumping them ahead of those characters that are pending under DMA. Fixes: 75df022 ("serial: 8250_dma: Fix RX handling") Cc: <stable@vger.kernel.org> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20221108121952.5497-5-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7090abd commit 1980860

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/tty/serial/8250/8250_port.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,10 +1901,9 @@ static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir)
19011901
if (!up->dma->rx_running)
19021902
break;
19031903
fallthrough;
1904+
case UART_IIR_RLSI:
19041905
case UART_IIR_RX_TIMEOUT:
19051906
serial8250_rx_dma_flush(up);
1906-
fallthrough;
1907-
case UART_IIR_RLSI:
19081907
return true;
19091908
}
19101909
return up->dma->rx_dma(up);

0 commit comments

Comments
 (0)