Skip to contentSkip to conversation

Patch "serial: sc16is7xx: Clear RS485 bits in the shutdown" has been added to the 4.9-stable tree

DISCUSSION Hui Wang 2 participants 2 messages Apr 1, 2022 1 message not in the archive Stable branch

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Hui Wang

author
#1 lore raw

Hi Greg,

Sorry, please don't apply the patch to stable kernels. I tried to add "linux,rs485-enabled-at-boot-time" support for this driver yesterday and found this patch is not correct, I will send a patch to revert this patch from the mainline kernel.

Thanks,

Hui.

Quoted 62 lines · On 4/1/22 18:38, [email protected] wrote:

This is a note to let you know that I've just added the patch titled

serial: sc16is7xx: Clear RS485 bits in the shutdown

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:

      serial-sc16is7xx-clear-rs485-bits-in-the-shutdown.patch

and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 927728a34f11b5a27f4610bdb7068317d6fdc72a Mon Sep 17 00:00:00 2001

From: Hui Wang <[email protected]>
Date: Tue, 8 Mar 2022 19:00:42 +0800
Subject: serial: sc16is7xx: Clear RS485 bits in the shutdown

From: Hui Wang <[email protected]>

commit 927728a34f11b5a27f4610bdb7068317d6fdc72a upstream.

We tested RS485 function on an EVB which has SC16IS752, after finishing the test, we started the RS232 function test, but found the RTS is still working in the RS485 mode.

That is because both startup and shutdown call port_update() to set the EFCR_REG, this will not clear the RS485 bits once the bits are set in the reconf_rs485(). To fix it, clear the RS485 bits in shutdown.

---
  drivers/tty/serial/sc16is7xx.c |    6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
drivers/tty/serial/sc16is7xx.c +4 -2
@@ -1055,10 +1055,12 @@ static void sc16is7xx_shutdown(struct ua
 
  	/* Disable all interrupts */
  	sc16is7xx_port_write(port, SC16IS7XX_IER_REG, 0);
-	/* Disable TX/RX */
+	/* Disable TX/RX, clear auto RS485 and RTS invert */
  	sc16is7xx_port_update(port, SC16IS7XX_EFCR_REG,
  			      SC16IS7XX_EFCR_RXDISABLE_BIT |
-			      SC16IS7XX_EFCR_TXDISABLE_BIT,
+			      SC16IS7XX_EFCR_TXDISABLE_BIT |
+			      SC16IS7XX_EFCR_AUTO_RS485_BIT |
+			      SC16IS7XX_EFCR_RTS_INVERT_BIT,
  			      SC16IS7XX_EFCR_RXDISABLE_BIT |
  			      SC16IS7XX_EFCR_TXDISABLE_BIT);
 

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/serial-sc16is7xx-clear-rs485-bits-in-the-shutdown.patch

maintainer
#2 lore raw
Quoted 6 lines · Hui Wang

Hi Greg,

Sorry, please don't apply the patch to stable kernels. I tried to add "linux,rs485-enabled-at-boot-time" support for this driver yesterday and found this patch is not correct, I will send a patch to revert this patch from the mainline kernel.

Now dropped from all queues, thanks for letting me know.

greg k-h