diff options
author | Ulrich Hecht <ulrich.hecht+renesas@gmail.com> | 2017-02-08 12:31:14 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-10 09:10:16 -0500 |
commit | 90afa5255f5c5ae67c869918e4c5f60b8580db70 (patch) | |
tree | de12ae1c357c5c6bcc335db5636d0474e0b7c982 | |
parent | 6a5f0e2f9352accf857f683518bd3cc6ef6ae6c6 (diff) |
serial: sh-sci: fix hardware RX trigger level setting
1. Do not set the RX trigger level for software timeout devices on reset;
there is no timeout by default, and data will rot.
2. Do set the RX trigger level for hardware timeout devices when set
via sysfs attribute.
Fixes SCIFA-type serial consoles.
Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index f95a56ca936e..9a47cc4f16a2 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -1076,8 +1076,11 @@ static ssize_t rx_trigger_store(struct device *dev, | |||
1076 | 1076 | ||
1077 | if (kstrtol(buf, 0, &r) == -EINVAL) | 1077 | if (kstrtol(buf, 0, &r) == -EINVAL) |
1078 | return -EINVAL; | 1078 | return -EINVAL; |
1079 | |||
1079 | sci->rx_trigger = scif_set_rtrg(port, r); | 1080 | sci->rx_trigger = scif_set_rtrg(port, r); |
1080 | scif_set_rtrg(port, 1); | 1081 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) |
1082 | scif_set_rtrg(port, 1); | ||
1083 | |||
1081 | return count; | 1084 | return count; |
1082 | } | 1085 | } |
1083 | 1086 | ||
@@ -2179,7 +2182,11 @@ static void sci_reset(struct uart_port *port) | |||
2179 | setup_timer(&s->rx_fifo_timer, rx_fifo_timer_fn, | 2182 | setup_timer(&s->rx_fifo_timer, rx_fifo_timer_fn, |
2180 | (unsigned long)s); | 2183 | (unsigned long)s); |
2181 | } else { | 2184 | } else { |
2182 | scif_set_rtrg(port, s->rx_trigger); | 2185 | if (port->type == PORT_SCIFA || |
2186 | port->type == PORT_SCIFB) | ||
2187 | scif_set_rtrg(port, 1); | ||
2188 | else | ||
2189 | scif_set_rtrg(port, s->rx_trigger); | ||
2183 | } | 2190 | } |
2184 | } | 2191 | } |
2185 | } | 2192 | } |