Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4429797pxf; Tue, 30 Mar 2021 07:39:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbgWHD65EFOjSmkk4WWjlRqcWGVMzatHd5JUolNSWyG5pwLB3jDBLcfbriREyu6Wsj5uuG X-Received: by 2002:aa7:c916:: with SMTP id b22mr34757186edt.299.1617115171917; Tue, 30 Mar 2021 07:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617115171; cv=none; d=google.com; s=arc-20160816; b=E0KStuPxiHhdGDb5U/7WnvcLcfkccklVbWPgySGntF7u8bBu9SCv5Qngbl8bM83W8W 66b6/Rzty4spWdCTOB8AtV0S14hv+wo29cC3nPVP6cthpCnjwss8+rTkbztwsC+PgStI HRJ3cUHFYHfQApXWTJDJz1sgESVyfILFMr27EeLFLyIC0TgS4+EJFPqPcwdDBgX9iNyB QUb736GJiQCM4WoeBON0b8C0eRqd+87qzsJGhNIg6zwkKQukyAWOm4ydsPYgI14ZAMZo HPWlnJrmH/kce8v1IY1m/3fqLR3Mzfh0bz0fXXpK96fmjAeBmo60a5ccVhWTgDg/JFP+ EaJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+YmGPBISYaoEkzOVrV2AsCINGfl+xRc2wLQCT2dkORk=; b=q9xJkjC4mh5s+pM6/YmqIbZaJvYH9KuAOSFTrVvUw3H0eLfbpX5clwdfxOUwVIoQsY uy5PUjFxkfnCQjcRk3wYqbDLIiI8mVq5VN/xLBukqTyLiw8G7E3umWG73Oz8GyuWzXEE dz0jeyVUe3sICTfeaAHz6HG0DSpeBnWT4EMQyddYlRvL6MWnqYru3cnT2PlT0ROPfYkV S80Ho2JESP0Pf3EE7vMfaComdcrex9gTnKH14xA0oJnEDpeVM+KS0qFyqX+C9oYgEsSS 3o9KdVpIm5OqYtUs0nXZ1DXfJ/S25noRvzLZ/V+3LEwG3PI1sL1XHhlizYW1g7pR50Mk iBfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HcRRgjIr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c18si14685451ejr.332.2021.03.30.07.39.08; Tue, 30 Mar 2021 07:39:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HcRRgjIr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231652AbhC3Ohl (ORCPT + 99 others); Tue, 30 Mar 2021 10:37:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:50402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231951AbhC3OhH (ORCPT ); Tue, 30 Mar 2021 10:37:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DD8C6619BD; Tue, 30 Mar 2021 14:37:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617115027; bh=7N5l3ZIfotiyDGJq6YGwcyxdCzpYtn6rXpIa367Go3Y=; h=From:To:Cc:Subject:Date:From; b=HcRRgjIrquW58c+zFBT5gMK5xmgyroMz/BfLYDySSGooyppWHSNR7k68zRsPYl8Pb 5YHAyAjg90bz1JejMDBtkEJEJgzxjpvW5SQu2HNp3j8iG5+dTAABbNiciBtCbNHZeQ LtoJ1+sH7gyZ2SoqTowP+pYWzn+zzVATzALAqw6vqk/JRa0ydki/Mc6ISAKvd3uVY2 ZEr4XLeJbWCFDSbyEVMEws4XxdKTlLaB6UA6XZdG9JR3mFRRE4HXmUiGKy06HFKZ03 iSRekWgQb4ovMvyBtwR2iKr5VghQigyfflTB8qxj2t8oBO7ceIoHHsGiCx+XT9b8ch 8j7eapmBL+YCw== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lRFUm-0002Ma-CH; Tue, 30 Mar 2021 16:37:28 +0200 From: Johan Hovold To: Johan Hovold Cc: Mauro Carvalho Chehab , Manivannan Sadhasivam , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] USB: serial: xr: fix CSIZE handling Date: Tue, 30 Mar 2021 16:37:16 +0200 Message-Id: <20210330143716.9042-1-johan@kernel.org> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The XR21V141X does not have a 5- or 6-bit mode, but the current implementation failed to properly restore the old setting when CS5 or CS6 was requested. Instead an invalid request would be sent to the device. Fixes: c2d405aa86b4 ("USB: serial: add MaxLinear/Exar USB to Serial driver") Signed-off-by: Johan Hovold --- drivers/usb/serial/xr_serial.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial/xr_serial.c index 0ca04906da4b..c59c8b47a120 100644 --- a/drivers/usb/serial/xr_serial.c +++ b/drivers/usb/serial/xr_serial.c @@ -467,6 +467,11 @@ static void xr_set_termios(struct tty_struct *tty, termios->c_cflag &= ~CSIZE; if (old_termios) termios->c_cflag |= old_termios->c_cflag & CSIZE; + else + termios->c_cflag |= CS8; + + if (C_CSIZE(tty) == CS7) + bits |= XR21V141X_UART_DATA_7; else bits |= XR21V141X_UART_DATA_8; break; -- 2.26.3