@@ -36,8 +36,15 @@ static void __dma_tx_complete(void *param)
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
uart_write_wakeup(&p->port);
- if (!uart_circ_empty(xmit) && !uart_tx_stopped(&p->port))
- serial8250_tx_dma(p);
+ if (!uart_circ_empty(xmit) && !uart_tx_stopped(&p->port)) {
+ int ret;
+
+ ret = serial8250_tx_dma(p);
+ if (ret && !(p->ier & UART_IER_THRI)) {
+ p->ier |= UART_IER_THRI;
+ serial_port_out(&p->port, UART_IER, p->ier);
+ }
+ }
spin_unlock_irqrestore(&p->port.lock, flags);
}
After TX dma completes the code will queue another DMA transfer. If serial8250_tx_dma() fails then there is no plan B to continue the transfer manually. This patch enables the TX-fifo empty event so it can be tried again via DMA or use the manual fallback in case it fails. Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- drivers/tty/serial/8250/8250_dma.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)