lkml.org 
[lkml]   [2017]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] serial: imx: Improve PIO prevention if TX DMA has been started
Date
The imx_transmit_buffer function should return if TX DMA has already
been started and not just skip over the buffer PIO write loop. (Which
did fix the initial problem, but could have unintentional side-effects)

Tested on an i.MX6Q board with half-duplex RS-485 and with RS-232.

Cc: Ian Jamison <ian.dev@arkver.com>
Cc: Uwe-Kleine König <u.kleine-koenig@pengutronix.de>
Fixes: 514ab34dbad6 ("serial: imx: Prevent TX buffer PIO write when a
DMA has been started")
Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
---
drivers/tty/serial/imx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 80934e7bd67f..fce538eb8c77 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -452,13 +452,14 @@ static inline void imx_transmit_buffer(struct imx_port *sport)
if (sport->dma_is_txing) {
temp |= UCR1_TDMAEN;
writel(temp, sport->port.membase + UCR1);
+ return;
} else {
writel(temp, sport->port.membase + UCR1);
imx_dma_tx(sport);
}
}

- while (!uart_circ_empty(xmit) && !sport->dma_is_txing &&
+ while (!uart_circ_empty(xmit) &&
!(readl(sport->port.membase + uts_reg(sport)) & UTS_TXFULL)) {
/* send xmit->buf[xmit->tail]
* out the port here */
--
2.14.1
\
 
 \ /
  Last update: 2017-08-12 17:23    [W:0.300 / U:3.912 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site