linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Su Bao Cheng <baocheng.su@siemens.com>
To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org,
	lukas@wunner.de
Cc: jan.kiszka@siemens.com, chao.zeng@siemens.com,
	Su Bao Cheng <baocheng.su@siemens.com>
Subject: [PATCH] Revert "serial: 8250: Don't touch RTS modem control while in rs485 mode"
Date: Wed, 27 Oct 2021 19:16:44 +0800	[thread overview]
Message-ID: <20211027111644.1996921-1-baocheng.su@siemens.com> (raw)

This reverts commit f45709df7731ad36306a28a3e1af7309d55c35f5.

The `serial8250_do_set_mctrl` not only used by userspace ioctl but
also the kernel itself.

During tty_open, the uart_port_startup sets the MCR to 0, and then use
set_mctrl to restore the MCR, so at this time, the MCR read does not
reflect the desired value.

Signed-off-by: Su Bao Cheng <baocheng.su@siemens.com>
---
 drivers/tty/serial/8250/8250_port.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index 66374704747e..40736e460956 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -2024,13 +2024,6 @@ void serial8250_do_set_mctrl(struct uart_port *port, unsigned int mctrl)
 	struct uart_8250_port *up = up_to_u8250p(port);
 	unsigned char mcr;
 
-	if (port->rs485.flags & SER_RS485_ENABLED) {
-		if (serial8250_in_MCR(up) & UART_MCR_RTS)
-			mctrl |= TIOCM_RTS;
-		else
-			mctrl &= ~TIOCM_RTS;
-	}
-
 	mcr = serial8250_TIOCM_to_MCR(mctrl);
 
 	mcr = (mcr & up->mcr_mask) | up->mcr_force | up->mcr;
-- 
2.25.1


             reply	other threads:[~2021-10-27 11:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 11:16 Su Bao Cheng [this message]
2021-10-27 11:39 ` [PATCH] Revert "serial: 8250: Don't touch RTS modem control while in rs485 mode" Lukas Wunner
2021-11-12  6:14   ` Su Bao Cheng
2021-11-19  8:00     ` Jan Kiszka
2021-11-19  8:43       ` Jan Kiszka
2021-11-19 11:17         ` Lukas Wunner
2021-11-19 11:12     ` Lukas Wunner
2021-11-20 17:18     ` Lukas Wunner
2021-11-21  9:00       ` Jan Kiszka
2021-11-21 17:43         ` Lukas Wunner
2021-11-22  9:01           ` Su Bao Cheng
2021-11-22 17:11             ` Lukas Wunner
2021-12-13 16:12         ` Lukas Wunner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211027111644.1996921-1-baocheng.su@siemens.com \
    --to=baocheng.su@siemens.com \
    --cc=chao.zeng@siemens.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jan.kiszka@siemens.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=lukas@wunner.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).