aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2013-10-11 03:39:07 -0400
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 09:05:47 -0400
commit1887e8d839cbe90b6f9c59d998739d12b45ff30b (patch)
tree80ffde983bcf259861943880affab12c8dc43b9a /drivers/tty
parentd61b9dac9ac2ba9bd7056b1bf0908dfbb000810c (diff)
serial: imx: fix the wrong number of scatterlist entries when xmit->head is 0
When the (xmit->tail > xmit->head) is true and the xmit->head is 0, we only need one DMA scatterlist in actually. Current code uses two DMA scatterlists in this case, this is obviously wrong. This patch fixes it. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/imx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index c6c3b160dac7..cadf7e5848b2 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -532,7 +532,7 @@ static void dma_tx_work(struct work_struct *w)
532 return; 532 return;
533 } 533 }
534 534
535 if (xmit->tail > xmit->head) { 535 if (xmit->tail > xmit->head && xmit->head > 0) {
536 sport->dma_tx_nents = 2; 536 sport->dma_tx_nents = 2;
537 sg_init_table(sgl, 2); 537 sg_init_table(sgl, 2);
538 sg_set_buf(sgl, xmit->buf + xmit->tail, 538 sg_set_buf(sgl, xmit->buf + xmit->tail,