diff options
-rw-r--r-- | drivers/tty/serial/imx.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index c8cfa0637128..88250395b0ce 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c | |||
@@ -911,6 +911,14 @@ static void dma_rx_callback(void *data) | |||
911 | 911 | ||
912 | status = dmaengine_tx_status(chan, (dma_cookie_t)0, &state); | 912 | status = dmaengine_tx_status(chan, (dma_cookie_t)0, &state); |
913 | count = RX_BUF_SIZE - state.residue; | 913 | count = RX_BUF_SIZE - state.residue; |
914 | |||
915 | if (readl(sport->port.membase + USR2) & USR2_IDLE) { | ||
916 | /* In condition [3] the SDMA counted up too early */ | ||
917 | count--; | ||
918 | |||
919 | writel(USR2_IDLE, sport->port.membase + USR2); | ||
920 | } | ||
921 | |||
914 | dev_dbg(sport->port.dev, "We get %d bytes.\n", count); | 922 | dev_dbg(sport->port.dev, "We get %d bytes.\n", count); |
915 | 923 | ||
916 | if (count) { | 924 | if (count) { |