]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00322581-01 tty: serial: imx: use workque to increase tx performance
authorRobin Gong <b38343@freescale.com>
Fri, 11 Jul 2014 09:56:55 +0000 (17:56 +0800)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:17:09 +0000 (21:17 -0600)
Use workque to submit tx dma request to increase tx performance.

(cherry picked from commit 17c20d9d290deb0dd24caed5c074125b0895bad5)

Signed-off-by: Robin Gong <b38343@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
drivers/tty/serial/imx.c

index 8511667f396a23d201669a25f7a02e920e7d3ddf..5ed34d17edbef39998f017e02a9b9467d88a415f 100644 (file)
@@ -225,6 +225,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];
 };
@@ -505,6 +506,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__);
@@ -512,8 +515,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;
@@ -604,7 +608,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;
        }
 
@@ -1146,6 +1150,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