From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f193.google.com ([209.85.216.193]:32986 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755751AbcLNP2l (ORCPT ); Wed, 14 Dec 2016 10:28:41 -0500 From: Johan Hovold To: linux-usb@vger.kernel.org Cc: Aidan Thornton , Grigori Goronzy , Karl Palsson , Russell Senior , Eddi De Pieri , Johan Hovold , stable Subject: [PATCH 02/13] USB: serial: ch341: fix open and resume after B0 Date: Wed, 14 Dec 2016 16:27:59 +0100 Message-Id: <20161214152810.14682-3-johan@kernel.org> In-Reply-To: <20161214152810.14682-1-johan@kernel.org> References: <20161214152810.14682-1-johan@kernel.org> Sender: stable-owner@vger.kernel.org List-ID: The private baud_rate variable is used to configure the port at open and reset-resume, which means it must never be set to (and left at) zero or reset-resume and all further open attempts will fail. Fixes: 664d5df92e88 ("USB: usb-serial ch341: support for DTR/RTS/CTS") Cc: stable Signed-off-by: Johan Hovold --- drivers/usb/serial/ch341.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index d133e72fe888..6279df905c14 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c @@ -355,7 +355,6 @@ static void ch341_set_termios(struct tty_struct *tty, baud_rate = tty_get_baud_rate(tty); - priv->baud_rate = baud_rate; ctrl = CH341_LCR_ENABLE_RX | CH341_LCR_ENABLE_TX; switch (C_CSIZE(tty)) { @@ -388,6 +387,9 @@ static void ch341_set_termios(struct tty_struct *tty, spin_lock_irqsave(&priv->lock, flags); priv->line_control |= (CH341_BIT_DTR | CH341_BIT_RTS); spin_unlock_irqrestore(&priv->lock, flags); + + priv->baud_rate = baud_rate; + r = ch341_init_set_baudrate(port->serial->dev, priv, ctrl); if (r < 0 && old_termios) { priv->baud_rate = tty_termios_baud_rate(old_termios); -- 2.10.2