Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1363261 > unrolled thread

[PATCH] Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250")

Started byyegorslists@googlemail.com
First post2016-03-23 10:00 +0100
Last post2016-03-24 08:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250") yegorslists@googlemail.com - 2016-03-23 10:00 +0100
    Re: [PATCH] Fixes: e490c9144cfa ("tty: Add software emulated RS485  support for 8250") Uwe Kleine-König   <u.kleine-koenig@pengutronix.de> - 2016-03-24 08:30 +0100

#1363261 — [PATCH] Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250")

Fromyegorslists@googlemail.com
Date2016-03-23 10:00 +0100
Subject[PATCH] Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250")
Message-ID<rfMNY-RM-9@gated-at.bofh.it>
From: Yegor Yefremov <yegorslists@googlemail.com>

When in half-duplex mode RX will be disabled before TX, but not
enabled after deactivating transmitter. This patch enables
UART_IER_RLSI and UART_IER_RDI interrupts after TX is over.

Cc: Matwey V. Kornilov <matwey@sai.msu.ru>
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 drivers/tty/serial/8250/8250_port.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index e213da0..00ad263 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -1403,9 +1403,18 @@ static void __do_stop_tx_rs485(struct uart_8250_port *p)
 	/*
 	 * Empty the RX FIFO, we are not interested in anything
 	 * received during the half-duplex transmission.
+	 * Enable previously disabled RX interrupts.
 	 */
-	if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX))
+	if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX)) {
 		serial8250_clear_fifos(p);
+
+		serial8250_rpm_get(p);
+
+		p->ier |= UART_IER_RLSI | UART_IER_RDI;
+		serial_port_out(&p->port, UART_IER, p->ier);
+
+		serial8250_rpm_put(p);
+	}
 }
 
 static void serial8250_em485_handle_stop_tx(unsigned long arg)
-- 
2.1.4

[toc] | [next] | [standalone]


#1363966 — Re: [PATCH] Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250")

FromUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date2016-03-24 08:30 +0100
SubjectRe: [PATCH] Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250")
Message-ID<rg7Sq-7F5-9@gated-at.bofh.it>
In reply to#1363261
Hello,

the subject doesn't look suitable. The Fixes:-line belongs into the
S-o-b paragraph, not the title.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web