summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2017-03-28 12:13:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-31 16:29:05 +0300
commit5f76895e4c712b1b5af450cf344389b8c53ac2c2 (patch)
treeb1d427346047aa90b6e84c1305d136986ddce570 /drivers
parente37f712f760478a3bce8a68b8d85b5b0bf6642eb (diff)
downloadlinux-5f76895e4c712b1b5af450cf344389b8c53ac2c2.tar.xz
serial: sh-sci: Fix late enablement of AUTORTS
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). Reported-by: Baumann, Christoph (C.) <cbaumann@visteon.com> Fixes: 33f50ffc253854cf ("serial: sh-sci: Fix support for hardware-assisted RTS/CTS") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/serial/sh-sci.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 446a23bee140..6e405fb5a23f 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2372,6 +2372,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));