aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorRobin Gong <b38343@freescale.com>2014-07-11 05:56:55 -0400
committerFugang Duan <b38611@freescale.com>2014-07-14 01:08:42 -0400
commit7cf9348a59423b889f8e0635e78f9ebff0ae5c42 (patch)
tree42f7e78a902bbe4e0b65f4f0d6e79a3ee46eaebc /drivers/tty
parente68e89999203310d91bf13e12e77df9c78537260 (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>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/imx.c10
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 {
226 void *rx_buf; 226 void *rx_buf;
227 unsigned int tx_bytes; 227 unsigned int tx_bytes;
228 unsigned int dma_tx_nents; 228 unsigned int dma_tx_nents;
229 struct work_struct tsk_dma_tx;
229 wait_queue_head_t dma_wait; 230 wait_queue_head_t dma_wait;
230 unsigned int saved_reg[11]; 231 unsigned int saved_reg[11];
231}; 232};
@@ -506,6 +507,8 @@ static void dma_tx_callback(void *data)
506 507
507 uart_write_wakeup(&sport->port); 508 uart_write_wakeup(&sport->port);
508 509
510 schedule_work(&sport->tsk_dma_tx);
511
509 if (waitqueue_active(&sport->dma_wait)) { 512 if (waitqueue_active(&sport->dma_wait)) {
510 wake_up(&sport->dma_wait); 513 wake_up(&sport->dma_wait);
511 dev_dbg(sport->port.dev, "exit in %s.\n", __func__); 514 dev_dbg(sport->port.dev, "exit in %s.\n", __func__);
@@ -513,8 +516,9 @@ static void dma_tx_callback(void *data)
513 } 516 }
514} 517}
515 518
516static void imx_dma_tx(struct imx_port *sport) 519static void dma_tx_work(struct work_struct *w)
517{ 520{
521 struct imx_port *sport = container_of(w, struct imx_port, tsk_dma_tx);
518 struct circ_buf *xmit = &sport->port.state->xmit; 522 struct circ_buf *xmit = &sport->port.state->xmit;
519 struct scatterlist *sgl = sport->tx_sgl; 523 struct scatterlist *sgl = sport->tx_sgl;
520 struct dma_async_tx_descriptor *desc; 524 struct dma_async_tx_descriptor *desc;
@@ -605,7 +609,7 @@ static void imx_start_tx(struct uart_port *port)
605 } 609 }
606 610
607 if (sport->dma_is_enabled) { 611 if (sport->dma_is_enabled) {
608 imx_dma_tx(sport); 612 schedule_work(&sport->tsk_dma_tx);
609 return; 613 return;
610 } 614 }
611 615
@@ -1147,6 +1151,8 @@ static int imx_startup(struct uart_port *port)
1147 } 1151 }
1148 } 1152 }
1149 1153
1154 INIT_WORK(&sport->tsk_dma_tx, dma_tx_work);
1155
1150 spin_lock_irqsave(&sport->port.lock, flags); 1156 spin_lock_irqsave(&sport->port.lock, flags);
1151 /* 1157 /*
1152 * Finally, clear and enable interrupts 1158 * Finally, clear and enable interrupts