aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorJiada Wang <jiada_wang@mentor.com>2014-12-09 04:11:30 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-09 17:23:07 -0500
commit0bbc9b81c1638f6e75c8ed423b5e6ae1a2035d79 (patch)
treefc5a6ce0b2610597c6d3dd6b5dc28e34c827ccd8 /drivers/tty
parentd64b8607aceb9bd3b3dabddfc4f76458e5a8489d (diff)
serial: imx: call imx_dma_tx() again in dma_tx_callback
Currently in dma_tx_callback(), no matter if there is still remaining data pending in circle buffer or not, DMA transmit will be terminated. This will result in some data never get transmitted. In order to fix this issue, call imx_dma_tx() again in dma_tx_callback, when there is pending data and uart hasn't been stopped. Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/imx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 73158d96822a..0e64f18f8c42 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -495,6 +495,7 @@ static inline void imx_transmit_buffer(struct imx_port *sport)
495 imx_stop_tx(&sport->port); 495 imx_stop_tx(&sport->port);
496} 496}
497 497
498static void imx_dma_tx(struct imx_port *sport);
498static void dma_tx_callback(void *data) 499static void dma_tx_callback(void *data)
499{ 500{
500 struct imx_port *sport = data; 501 struct imx_port *sport = data;
@@ -524,6 +525,11 @@ static void dma_tx_callback(void *data)
524 dev_dbg(sport->port.dev, "exit in %s.\n", __func__); 525 dev_dbg(sport->port.dev, "exit in %s.\n", __func__);
525 return; 526 return;
526 } 527 }
528
529 spin_lock_irqsave(&sport->port.lock, flags);
530 if (!uart_circ_empty(xmit) && !uart_tx_stopped(&sport->port))
531 imx_dma_tx(sport);
532 spin_unlock_irqrestore(&sport->port.lock, flags);
527} 533}
528 534
529static void imx_dma_tx(struct imx_port *sport) 535static void imx_dma_tx(struct imx_port *sport)