aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorJiada Wang <jiada_wang@mentor.com>2014-12-09 04:11:29 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-09 17:23:07 -0500
commitd64b8607aceb9bd3b3dabddfc4f76458e5a8489d (patch)
tree12a74a895defc98a81441333bcedfd8c776031f4 /drivers/tty
parent42f752b3fbcfee9c27e4f6f6216e60e130ba98c8 (diff)
Revert "serial: imx: always wake up the processes in the TX callback"
This reverts commit 2ad28e3efee21a5bbf940c83d1f0395b76bd3efb. Instead of always wake up write_wait process in TX callback, TX callback should call imx_dma_tx() again, and let imx_dma_tx transfer the remaining data in circle buffer. The issue with commit 2ad28e3 is, in case there is remaining data in circle buffer, but no process is waiting on write_wait queue, then as no following uart_write() will be called after uart_write_wakeup(), thus cause data loss. Moreover according to Documentation/serial/driver, uart_write_wakeup() should be called in case the transmit buffer have dropped below a threshold. Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/imx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 1c4f367b6fb6..73158d96822a 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -516,7 +516,8 @@ static void dma_tx_callback(void *data)
516 516
517 spin_unlock_irqrestore(&sport->port.lock, flags); 517 spin_unlock_irqrestore(&sport->port.lock, flags);
518 518
519 uart_write_wakeup(&sport->port); 519 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
520 uart_write_wakeup(&sport->port);
520 521
521 if (waitqueue_active(&sport->dma_wait)) { 522 if (waitqueue_active(&sport->dma_wait)) {
522 wake_up(&sport->dma_wait); 523 wake_up(&sport->dma_wait);