Skip to content

Commit

Permalink
tty: serial: fsl_lpuart: Ignore TX/RX interrupts if DMA is enabled
Browse files Browse the repository at this point in the history
In a mixed DMA/IRQ use-case (e.g.: DMA for TX, IRQ for RX), interrupt
handler might try to handle Rx/Tx condition it shouldn't. Change the
code to only handle TX/RX event if corresponding path isn't being
handled by DMA.

Signed-off-by: Andrey Smirnov <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Chris Healy <[email protected]>
Cc: Cory Tusar <[email protected]>
Cc: Lucas Stach <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
ndreys authored and gregkh committed Sep 4, 2019
1 parent f7ec172 commit 6798e90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/tty/serial/fsl_lpuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -967,10 +967,10 @@ static irqreturn_t lpuart_int(int irq, void *dev_id)

sts = readb(sport->port.membase + UARTSR1);

if (sts & UARTSR1_RDRF)
if (sts & UARTSR1_RDRF && !sport->lpuart_dma_rx_use)
lpuart_rxint(sport);

if (sts & UARTSR1_TDRE)
if (sts & UARTSR1_TDRE && !sport->lpuart_dma_tx_use)
lpuart_txint(sport);

return IRQ_HANDLED;
Expand Down

0 comments on commit 6798e90

Please sign in to comment.