blob: 5358670bba281491dda618c7fc61ce9aa7ed0660 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
From 8b5bbc523cf41fbb8e657f9c81d7821b04ac1b89 Mon Sep 17 00:00:00 2001
From: Valentine Barshak <valentine.barshak@cogentembedded.com>
Date: Mon, 26 Nov 2018 05:55:03 +0300
Subject: [PATCH 055/122] serial: sh-sci: Fix minimal rx_timeout value
Commit "serial: sh-sci: use hrtimer for receive timeout"
breaks rx_timeout limit check. It used to be calculated
in jiffies and the minimal value was msecs_to_jiffies(20).
Since rx_timeout is now measured in uS, the minimal value
should be 20000 instead of 20.
Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
---
drivers/tty/serial/sh-sci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index eba08cd..7ab614f 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2523,8 +2523,8 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
s->rx_frame = (10000 * bits) / (baud / 100);
#ifdef CONFIG_SERIAL_SH_SCI_DMA
s->rx_timeout = s->buf_len_rx * 2 * s->rx_frame;
- if (s->rx_timeout < 20)
- s->rx_timeout = 20;
+ if (s->rx_timeout < 20000)
+ s->rx_timeout = 20000;
#endif
if ((termios->c_cflag & CREAD) != 0)
--
2.7.4
|