diff options
author | Fugang Duan <b38611@freescale.com> | 2014-08-21 09:11:06 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2015-01-15 21:18:19 -0600 |
commit | 1a89b438399ea9ec21391fe82527d21d7215cb5e (patch) | |
tree | 7876d83c62460ab10a9d813e539b2e7198cf3ad4 /drivers/tty/serial | |
parent | e3a11cdcc1602ef21856c96264927d689373bafb (diff) |
ENGR00329822-05 tty: serial: imx: use delayed work for transmit task
Use delayed work to schdule the transmit work to send out the last
data to avoid that the rest of data in xmit buffer cannot be sent out.
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit 230562fe3d44fd0d33bddd409cf254b8c1ec43c5)
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r-- | drivers/tty/serial/imx.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 41d5ebb48816..afcf0a598abe 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -244,7 +244,7 @@ struct imx_port { struct imx_dma_rxbuf rx_buf; unsigned int tx_bytes; unsigned int dma_tx_nents; - struct work_struct tsk_dma_tx; + struct delayed_work tsk_dma_tx; struct delayed_work tsk_dma_rx; wait_queue_head_t dma_wait; unsigned int saved_reg[11]; @@ -530,7 +530,7 @@ static void dma_tx_callback(void *data) smp_mb__after_clear_bit(); uart_write_wakeup(&sport->port); - schedule_work(&sport->tsk_dma_tx); + schedule_delayed_work(&sport->tsk_dma_tx, msecs_to_jiffies(1)); if (waitqueue_active(&sport->dma_wait)) { wake_up(&sport->dma_wait); @@ -541,7 +541,8 @@ static void dma_tx_callback(void *data) static void dma_tx_work(struct work_struct *w) { - struct imx_port *sport = container_of(w, struct imx_port, tsk_dma_tx); + struct delayed_work *delay_work = to_delayed_work(w); + struct imx_port *sport = container_of(delay_work, struct imx_port, tsk_dma_tx); struct circ_buf *xmit = &sport->port.state->xmit; struct scatterlist *sgl = sport->tx_sgl; struct dma_async_tx_descriptor *desc; @@ -639,7 +640,7 @@ static void imx_start_tx(struct uart_port *port) } if (sport->dma_is_enabled) { - schedule_work(&sport->tsk_dma_tx); + schedule_delayed_work(&sport->tsk_dma_tx, 0); return; } @@ -1221,7 +1222,7 @@ static int imx_startup(struct uart_port *port) imx_uart_dma_init(sport); if (sport->dma_is_inited) { - INIT_WORK(&sport->tsk_dma_tx, dma_tx_work); + INIT_DELAYED_WORK(&sport->tsk_dma_tx, dma_tx_work); INIT_DELAYED_WORK(&sport->tsk_dma_rx, dma_rx_work); } |