Message ID | 857E9EDCA6C0904DB3357321AA9123EBE14B5A2C@NA-MBX-03.mgc.mentorg.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, May 30, 2014 at 09:27:20AM +0000, Wang, Jiada (ESD) wrote: > Hi Shijie > > After apply this patch into our kernel, > We are facing data hang issue when sending big size file (2M used in test) to uart port > Note: Rx port is also keep receiving data. > > After read the implementation of uart_stop(), > I feel like, stop_tx() is used to perform flow control when like a XOFF is received. > Which means no data should be dropped, as they may need to be sent out, > When next start_tx() is called. > > But by calling dmaengine_termiate_all(), the data already be submitted to DMA engine, > May be lost, thus cause data hang. > > What do you think? This patch has been reverted by Greg. I also noticed the data loss issue. thanks Huang Shijie
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index d1f16d3..ed6cdf7 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -225,7 +225,6 @@ struct imx_port { void *rx_buf; unsigned int tx_bytes; unsigned int dma_tx_nents; - wait_queue_head_t dma_wait; unsigned int saved_reg[11]; }; @@ -417,12 +416,10 @@ static void imx_stop_tx(struct uart_port *port) return; } - /* - * We are maybe in the SMP context, so if the DMA TX thread is running - * on other cpu, we have to wait for it to finish. - */ - if (sport->dma_is_enabled && sport->dma_is_txing) - return; + if (sport->dma_is_enabled && sport->dma_is_txing) { + dmaengine_terminate_all(sport->dma_chan_tx); + sport->dma_is_txing = 0; + } temp = readl(sport->port.membase + UCR1); writel(temp & ~UCR1_TXMPTYEN, sport->port.membase + UCR1); @@ -436,12 +433,10 @@ static void imx_stop_rx(struct uart_port *port)