Skip to contentSkip to conversation

Patch "serial: sh-sci: Fix late enablement of AUTORTS" has been added to the 4.11-stable tree

PATCH [email protected] 1 participant 1 message Jun 18, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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

serial: sh-sci: Fix late enablement of AUTORTS

to the 4.11-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-sh-sci-fix-late-enablement-of-autorts.patch
and it can be found in the queue-4.11 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 5f76895e4c712b1b5af450cf344389b8c53ac2c2 Mon Sep 17 00:00:00 2001

From: Geert Uytterhoeven <[email protected]>
Date: Tue, 28 Mar 2017 11:13:45 +0200
Subject: serial: sh-sci: Fix late enablement of AUTORTS

From: Geert Uytterhoeven <[email protected]>

commit 5f76895e4c712b1b5af450cf344389b8c53ac2c2 upstream.

When changing hardware control flow for a UART with dedicated RTS/CTS pins, the new AUTORTS state is not immediately reflected in the hardware, but only when RTS is raised. However, the serial core does not call .set_mctrl() after .set_termios(), hence AUTORTS may only become effective when the port is closed, and reopened later. Note that this problem does not happen when manually using stty to change CRTSCTS, as AUTORTS will work fine on next open.

To fix this, call .set_mctrl() from .set_termios() when dedicated RTS/CTS pins are present, to refresh the AUTORTS or RTS state. This is similar to what other drivers supporting AUTORTS do (e.g. omap-serial).

Fixes 33f50ffc253854cf ("serial: sh-sci: Fix support for hardware-assisted RTS/CTS")
---
 drivers/tty/serial/sh-sci.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/tty/serial/sh-sci.c +4 -0
@@ -2389,6 +2389,10 @@ done:
 
 		serial_port_out(port, SCFCR, ctrl);
 	}
+	if (port->flags & UPF_HARD_FLOW) {
+		/* Refresh (Auto) RTS */
+		sci_set_mctrl(port, port->mctrl);
+	}
 
 	scr_val |= SCSCR_RE | SCSCR_TE |
 		   (s->cfg->scscr & ~(SCSCR_CKE1 | SCSCR_CKE0));

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

queue-4.11/serial-sh-sci-fix-late-enablement-of-autorts.patch queue-4.11/serial-sh-sci-fix-auto-rts-in-sci_init_pins.patch