mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 08:35:19 -05:00
serial: 8250_dma: Fix RX handling
Overrun, parity and framing errors should be handled in 8250_core. This also adds check for the dma_status and exits if the channel is not idle. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5ea5b24da8
commit
75df022b5f
1 changed files with 16 additions and 7 deletions
|
@ -101,20 +101,29 @@ int serial8250_rx_dma(struct uart_8250_port *p, unsigned int iir)
|
||||||
struct dma_tx_state state;
|
struct dma_tx_state state;
|
||||||
int dma_status;
|
int dma_status;
|
||||||
|
|
||||||
/*
|
dma_status = dmaengine_tx_status(dma->rxchan, dma->rx_cookie, &state);
|
||||||
* If RCVR FIFO trigger level was not reached, complete the transfer and
|
|
||||||
* let 8250.c copy the remaining data.
|
switch (iir & 0x3f) {
|
||||||
*/
|
case UART_IIR_RLSI:
|
||||||
if ((iir & 0x3f) == UART_IIR_RX_TIMEOUT) {
|
/* 8250_core handles errors and break interrupts */
|
||||||
dma_status = dmaengine_tx_status(dma->rxchan, dma->rx_cookie,
|
return -EIO;
|
||||||
&state);
|
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) {
|
if (dma_status == DMA_IN_PROGRESS) {
|
||||||
dmaengine_pause(dma->rxchan);
|
dmaengine_pause(dma->rxchan);
|
||||||
__dma_rx_complete(p);
|
__dma_rx_complete(p);
|
||||||
}
|
}
|
||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dma_status)
|
||||||
|
return 0;
|
||||||
|
|
||||||
desc = dmaengine_prep_slave_single(dma->rxchan, dma->rx_addr,
|
desc = dmaengine_prep_slave_single(dma->rxchan, dma->rx_addr,
|
||||||
dma->rx_size, DMA_DEV_TO_MEM,
|
dma->rx_size, DMA_DEV_TO_MEM,
|
||||||
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
||||||
|
|
Loading…
Add table
Reference in a new issue