From f3cb675102a2a5a330038c4e748f02b02cec989e Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Mon, 22 Jul 2024 09:30:54 +0100 Subject: [PATCH 1195/1215] tty/serial: pl011: restrict RX burst FIFO threshold If the associated DMA controller has lower burst length support than the level the FIFO is set to, then bytes will be left in the RX FIFO at the end of a DMA block - requiring a round-trip through the timeout interrupt handler rather than an end-of-block DMA interrupt. Signed-off-by: Jonathan Bell --- drivers/tty/serial/amba-pl011.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -487,6 +487,12 @@ static void pl011_dma_probe(struct uart_ "RX DMA disabled - no residue processing\n"); return; } + /* + * DMA controllers with smaller burst capabilities than 1/4 + * the FIFO depth will leave more bytes than expected in the + * RX FIFO if mismatched. + */ + rx_conf.src_maxburst = min(caps.max_burst, rx_conf.src_maxburst); } dmaengine_slave_config(chan, &rx_conf); uap->dmarx.chan = chan;