Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp351022rdh; Thu, 26 Oct 2023 04:14:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMtmdwYSfGmKQDOSvkM2hIAsmE3zX52FpkvMTkP3cGY0PVkcIF9DqkcM7iNEih6vu3bVs+ X-Received: by 2002:a25:2412:0:b0:da0:95c0:d157 with SMTP id k18-20020a252412000000b00da095c0d157mr2866857ybk.51.1698318850270; Thu, 26 Oct 2023 04:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698318850; cv=none; d=google.com; s=arc-20160816; b=tfFj+NqrHlmNzR3MJiDbkeA8kIKyf18ADM+/+FLMBP5sXKK8VBYQKtMiPYWKIjUrve 3vpCkQLTrZUX+VO/oNo3cjBBt6eGS+BaVh4yCppxYpxl3e2WlhqbRmm1YU5B0tlT/Jfm QCqU1y0Ce7KLjFtApbRSHceJlhsOtFQKvq11Iv+IiGppOje9WLLkJnW9BSdhQvLSFF9J OMfq+5hFjNBsUgKjPb7A0IMbdzp2fRTW+/vtYEnHLs57//g48ZDdLpuVSvLw25ZuwJvk EJ9qgFIINW+08ugR238dmFuZNGKmG+w2AYW7zPsQjSdTktIXOfxpFYg8W48uW4h+UuzE q4uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=CtAMpaorhDtm+zb1wbuRyrCAttDxrrBLNCQiwM4FfIE=; fh=OfFiVOmV71I3as012yY0yHHecaWcmjUkMH3OL3mfZIc=; b=Py6E1s0SAInzeJupFhkkjek2aZOsM7y0+nI7vYVOdfpPexLcL/BBrdkdM9ZpoX5VvE 0Hnp70u9hsELi5i+IG+0jxQizZ3SUvi1NcCf5KIQdd5Wjuu8CqX5SKOvzymSDbMMNfnQ ZjU3oaD9BiMg07sqnmJq2qOhp3fY+7SUfQi+V/Wr/4aUAcCycxfhkHFtH8bBc0c8yV4+ btNItyGLtxUVxRqk3boc/IH/XLTpqAuzGfcmgFW+E6S4ahvXrxWEb1KKELpNTJ5QQ+dG 0yp1T0NWp9Rs0XNRHQGuoUUFGdBjOYT2sLE4qQo0oZEv6+bb3iR+WVqbPUyx7Ysbjk7e dmpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HuE1j0Ll; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id y22-20020a253216000000b00d9cb25e8104si13821423yby.7.2023.10.26.04.14.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 04:14:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HuE1j0Ll; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 810298135D5F; Thu, 26 Oct 2023 04:14:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344699AbjJZLN7 (ORCPT + 99 others); Thu, 26 Oct 2023 07:13:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjJZLN6 (ORCPT ); Thu, 26 Oct 2023 07:13:58 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF18D1AE; Thu, 26 Oct 2023 04:13:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698318836; x=1729854836; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=3TAab8TB4vv1p66SQlnTI2bAv1DAoX27ePZ2oXPLufM=; b=HuE1j0LlpNSXoiM1Xf38fyy63ylasWnknFre5x6ULCDy42jictep2mdN rO89OU5NrHVQTaTkCtJBUmdf9TUdNfoU0p0CMgsTO1tsf6hRzrw8VhYX6 akQhY1tWrA1XiZFXTnksjWl76WqO1FRIPzWWjIiFSaK8PxrpFWYYZpl5E aousc+OrB76DDFuF6W/57+g7UzSaYPGp6tPCCHmSjg7Sa5I6RPYlA9/C8 MdxBatMDWVx24fYzwCb/7rwVvbiwvQy5sLgAoEzSFx/Brt3f5HANswRUU exd3+IxElZa3iUOEpjv3RTJPVs8hOeOROPx4Lf4BK6ImKn33haOZTBuh6 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="9071611" X-IronPort-AV: E=Sophos;i="6.03,253,1694761200"; d="scan'208";a="9071611" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 04:13:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="794167959" X-IronPort-AV: E=Sophos;i="6.03,253,1694761200"; d="scan'208";a="794167959" Received: from weissenb-mobl1.ger.corp.intel.com ([10.252.32.65]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 04:13:51 -0700 Date: Thu, 26 Oct 2023 14:13:49 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: =?ISO-8859-15?Q?Th=E9o_Lebrun?= cc: Russell King , Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Linus Walleij , Gregory CLEMENT , Alexandre Belloni , Thomas Petazzoni , Vladimir Kondratiev , Tawfik Bayouk Subject: Re: [PATCH 6/6] tty: serial: amba-pl011: Parse bits option as 5, 6, 7 or 8 in _get_options In-Reply-To: <20231026-mbly-uart-v1-6-9258eea297d3@bootlin.com> Message-ID: <3cc1f559-468-8a58-a919-bdfb45ecc90@linux.intel.com> References: <20231026-mbly-uart-v1-0-9258eea297d3@bootlin.com> <20231026-mbly-uart-v1-6-9258eea297d3@bootlin.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-427932746-1698318835=:2173" X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 26 Oct 2023 04:14:07 -0700 (PDT) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-427932746-1698318835=:2173 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Thu, 26 Oct 2023, Théo Lebrun wrote: > pl011_console_get_options() gets called to retrieve currently configured > options from the registers. Previously, LCRH_TX.WLEN was being parsed > as either 7 or 8 (fallback). Hardware supports values from 5 to 8 > inclusive, which pl011_set_termios() exploits for example. > > Signed-off-by: Théo Lebrun > --- > drivers/tty/serial/amba-pl011.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c > index 5774d48c7f16..b2062e4cbbab 100644 > --- a/drivers/tty/serial/amba-pl011.c > +++ b/drivers/tty/serial/amba-pl011.c > @@ -2384,10 +2384,7 @@ static void pl011_console_get_options(struct uart_amba_port *uap, int *baud, > *parity = 'o'; > } > > - if ((lcr_h & 0x60) == UART01x_LCRH_WLEN_7) > - *bits = 7; > - else > - *bits = 8; > + *bits = FIELD_GET(0x60, lcr_h) + 5; /* from 5 to 8 inclusive */ 0x60 needs to be replaced with a named define! -- i. --8323329-427932746-1698318835=:2173--