diff options
author | Robin Gong <b38343@freescale.com> | 2014-07-11 17:56:55 +0800 |
---|---|---|
committer | Fugang Duan <b38611@freescale.com> | 2014-07-14 13:08:42 +0800 |
commit | 7cf9348a59423b889f8e0635e78f9ebff0ae5c42 (patch) | |
tree | 42f7e78a902bbe4e0b65f4f0d6e79a3ee46eaebc | |
parent | e68e89999203310d91bf13e12e77df9c78537260 (diff) |
ENGR00322581-01 tty: serial: imx: use workque to increase tx performance
Use workque to submit tx dma request to increase tx performance.
Signed-off-by: Robin Gong <b38343@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
-rw-r--r-- | drivers/tty/serial/imx.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 5ecaee07cbac..e08ed72e4b99 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -226,6 +226,7 @@ struct imx_port { void *rx_buf; unsigned int tx_bytes; unsigned int dma_tx_nents; + struct work_struct tsk_dma_tx; wait_queue_head_t dma_wait; unsigned int saved_reg[11]; }; @@ -506,6 +507,8 @@ static void dma_tx_callback(void *data) uart_write_wakeup(&sport->port); + schedule_work(&sport->tsk_dma_tx); + if (waitqueue_active(&sport->dma_wait)) { wake_up(&sport->dma_wait); dev_dbg(sport->port.dev, "exit in %s.\n", __func__); @@ -513,8 +516,9 @@ static void dma_tx_callback(void *data) } } -static void imx_dma_tx(struct imx_port *sport) +static void dma_tx_work(struct work_struct *w) { + struct imx_port *sport = container_of(w, 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; @@ -605,7 +609,7 @@ static void imx_start_tx(struct uart_port *port) } if (sport->dma_is_enabled) { - imx_dma_tx(sport); + schedule_work(&sport->tsk_dma_tx); return; } @@ -1147,6 +1151,8 @@ static int imx_startup(struct uart_port *port) } } + INIT_WORK(&sport->tsk_dma_tx, dma_tx_work); + spin_lock_irqsave(&sport->port.lock, flags); /* * Finally, clear and enable interrupts |