Browse Source

serial: 8250_omap: Account for data in flight during DMA teardown

Take into account data stuck in DMA internal buffers before pushing data to
higher layer. dma_tx_state has "in_flight_bytes" member that provides this
information.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Vignesh Raghavendra 6 years ago
parent
commit
71b441a416
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/tty/serial/8250/8250_omap.c

+ 1 - 1
drivers/tty/serial/8250/8250_omap.c

@@ -781,7 +781,7 @@ static void __dma_rx_do_complete(struct uart_8250_port *p)
 	dma->rx_running = 0;
 	dmaengine_tx_status(dma->rxchan, dma->rx_cookie, &state);
 
-	count = dma->rx_size - state.residue;
+	count = dma->rx_size - state.residue + state.in_flight_bytes;
 	if (count < dma->rx_size)
 		dmaengine_terminate_async(dma->rxchan);
 	if (!count)