Skip to contentSkip to conversation

serial: 8250_dma: terminate transfer explicitly when timeout

PATCH New Andy Shevchenko 1 participant 1 message Nov 28, 2014 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: 8250_dma: terminate transfer explicitly when timeout

There is no need to terminate transfer in the __dma_rx_complete() since it's called at the end of transfer. Special case when serial timeout occurs is handled separately where we have to terminate transfer.

---
 drivers/tty/serial/8250/8250_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_dma.c +1 -1
index fcd7ac6..e508939 100644
@@ -59,7 +59,6 @@ static void __dma_rx_complete(void *param)
 
 	dma->rx_running = 0;
 	dmaengine_tx_status(dma->rxchan, dma->rx_cookie, &state);
-	dmaengine_terminate_all(dma->rxchan);
 
 	count = dma->rx_size - state.residue;
 
@@ -131,6 +130,7 @@ int serial8250_rx_dma(struct uart_8250_port *p, unsigned int iir)
 		if (dma->rx_running) {
 			dmaengine_pause(dma->rxchan);
 			__dma_rx_complete(p);
+			dmaengine_terminate_all(dma->rxchan);
 		}
 		return -ETIMEDOUT;
 	default:
Signature · 1 line
2.1.3