From e9da290e4120317c8a7376bb375e2166804f4b68 Mon Sep 17 00:00:00 2001
From: Christoph Baumann <cbaumann@visteon.com>
Date: Fri, 12 Aug 2016 16:58:39 +0200
Subject: [PATCH] fix noflow->flow (RTS/CTS) transition

---
 drivers/tty/serial/sh-sci.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index b981fca..eea8e15 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1883,8 +1883,9 @@ static void sci_set_mctrl(struct uart_port *port, unsigned int mctrl)
 
 	mctrl_gpio_set(s->gpios, mctrl);
 
-	if (!(s->cfg->capabilities & SCIx_HAVE_RTSCTS))
+	if (!(s->cfg->capabilities & SCIx_HAVE_RTSCTS)) {
 		return;
+	}
 
 	if (!(mctrl & TIOCM_RTS)) {
 		/* Disable Auto RTS */
@@ -2328,7 +2329,7 @@ done:
 	s->autorts = false;
 	reg = sci_getreg(port, SCFCR);
 	if (reg->size) {
-		unsigned short ctrl = serial_port_in(port, SCFCR);
+		u16 ctrl = serial_port_in(port, SCFCR);
 
 		if ((port->flags & UPF_HARD_FLOW) &&
 		    (termios->c_cflag & CRTSCTS)) {
@@ -2336,6 +2337,8 @@ done:
 			port->status |= UPSTAT_AUTOCTS;
 			/* MCE is enabled when RTS is raised */
 			s->autorts = true;
+			ctrl |= SCFCR_MCE;
+			sci_set_rts(port, 1);
 		}
 
 		/*
-- 
2.9.3

