]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.44/usb-serial-ch341-fix-open-and-resume-after-b0.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.44 / usb-serial-ch341-fix-open-and-resume-after-b0.patch
1 From a20047f36e2f6a1eea4f1fd261aaa55882369868 Mon Sep 17 00:00:00 2001
2 From: Johan Hovold <johan@kernel.org>
3 Date: Fri, 6 Jan 2017 19:15:11 +0100
4 Subject: USB: serial: ch341: fix open and resume after B0
5
6 From: Johan Hovold <johan@kernel.org>
7
8 commit a20047f36e2f6a1eea4f1fd261aaa55882369868 upstream.
9
10 The private baud_rate variable is used to configure the port at open and
11 reset-resume and must never be set to (and left at) zero or reset-resume
12 and all further open attempts will fail.
13
14 Fixes: aa91def41a7b ("USB: ch341: set tty baud speed according to tty struct")
15 Fixes: 664d5df92e88 ("USB: usb-serial ch341: support for DTR/RTS/CTS")
16 Signed-off-by: Johan Hovold <johan@kernel.org>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18
19 ---
20 drivers/usb/serial/ch341.c | 3 +--
21 1 file changed, 1 insertion(+), 2 deletions(-)
22
23 --- a/drivers/usb/serial/ch341.c
24 +++ b/drivers/usb/serial/ch341.c
25 @@ -361,12 +361,11 @@ static void ch341_set_termios(struct tty
26
27 baud_rate = tty_get_baud_rate(tty);
28
29 - priv->baud_rate = baud_rate;
30 -
31 if (baud_rate) {
32 spin_lock_irqsave(&priv->lock, flags);
33 priv->line_control |= (CH341_BIT_DTR | CH341_BIT_RTS);
34 spin_unlock_irqrestore(&priv->lock, flags);
35 + priv->baud_rate = baud_rate;
36 ch341_set_baudrate(port->serial->dev, priv);
37 } else {
38 spin_lock_irqsave(&priv->lock, flags);