From cb285f4a9587276bf836c29dfed7730f12221397 Mon Sep 17 00:00:00 2001 From: Heikki Krogerus Date: Wed, 10 Apr 2013 16:58:25 +0300 Subject: [PATCH] --- yaml --- r: 364301 b: refs/heads/master c: 75df022b5f8982a375adb04e9e4c0a34a9689ed9 h: refs/heads/master i: 364299: 73b50b525009bf8c5bb643982900a5b80e191006 v: v3 --- [refs] | 2 +- trunk/drivers/tty/serial/8250/8250_dma.c | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 9ec6a7b60a80..67196e6a4b2a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5ea5b24da80322b8136cb000a7340cdc29a3d6dc +refs/heads/master: 75df022b5f8982a375adb04e9e4c0a34a9689ed9 diff --git a/trunk/drivers/tty/serial/8250/8250_dma.c b/trunk/drivers/tty/serial/8250/8250_dma.c index ce2518d5dfd1..66430614510a 100644 --- a/trunk/drivers/tty/serial/8250/8250_dma.c +++ b/trunk/drivers/tty/serial/8250/8250_dma.c @@ -101,20 +101,29 @@ int serial8250_rx_dma(struct uart_8250_port *p, unsigned int iir) struct dma_tx_state state; int dma_status; - /* - * If RCVR FIFO trigger level was not reached, complete the transfer and - * let 8250.c copy the remaining data. - */ - if ((iir & 0x3f) == UART_IIR_RX_TIMEOUT) { - dma_status = dmaengine_tx_status(dma->rxchan, dma->rx_cookie, - &state); + dma_status = dmaengine_tx_status(dma->rxchan, dma->rx_cookie, &state); + + switch (iir & 0x3f) { + case UART_IIR_RLSI: + /* 8250_core handles errors and break interrupts */ + return -EIO; + case UART_IIR_RX_TIMEOUT: + /* + * If RCVR FIFO trigger level was not reached, complete the + * transfer and let 8250_core copy the remaining data. + */ if (dma_status == DMA_IN_PROGRESS) { dmaengine_pause(dma->rxchan); __dma_rx_complete(p); } return -ETIMEDOUT; + default: + break; } + if (dma_status) + return 0; + desc = dmaengine_prep_slave_single(dma->rxchan, dma->rx_addr, dma->rx_size, DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);