Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp257794rdb; Tue, 31 Oct 2023 06:52:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHqt/k7XF2ZeG9UV4IPDu9GMqs0zkbtEHIPoh3sGLltby8GHbrMP5ENUdQf59LKK5D5ao1p X-Received: by 2002:a17:902:d4c9:b0:1cc:4e79:4b38 with SMTP id o9-20020a170902d4c900b001cc4e794b38mr6455383plg.3.1698760320139; Tue, 31 Oct 2023 06:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698760320; cv=none; d=google.com; s=arc-20160816; b=tIB1ZpQJBs0N48QnVXzv96Ac44dz0UPmAFFA5NuGj+rTBMglUdqye3yaNFcJMYTDXc olJFDqB9fmJ0++11XyM4TNNvsqfLCWIpCal4Dej0tMiFBACN0PV/QEp1Z5wBCGury3Is DWN1ase8zI4SfPzxPNDfZX2VpMh5ahqKM95lV52OsLHnmLHXjT0DcIKHNxUpF7DoOQX1 2LN/DCNWeSuHzK5+bvBTiItQgB/c2PmwRyRNdc9SW9Cj+4ojudmalLLzrCgJ7/yt9Wfn 8/AKtjLky708bULL16zdL2AKkb33X6O393ObejJoX0m9hu/0VyYEv2caNMLWbzQmgVZK i96A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:message-id:from:to:cc :subject:date:content-transfer-encoding:mime-version:dkim-signature; bh=lh/+wUApvt6UyuoxEjUcgfFXqmHXTrUff3SZed4i+ZQ=; fh=dC3j/OHfXXxiP+Aer8KXvCEgSwLiQ2nuOQ91naJBNlM=; b=QtL4dCsH5nm/VNFIowDRcDOlpVD4ayyD9nysPe6gUfx1nvrWDwF5dprlUIQSfHM6sa MAbBUtpdT1G+nimUgFL0My045a8xQ5wqpo949Hlffca+os45OFy/PDDVtgaEnTUL3M1R JU0PMWCckg4RvEVJ1NHybWQ/Nz4w2jKI6vOykXbFPoWE7HRMpl8tfri9z3UkSt46wYYL xoflL9xuTkPjsxMck7ZWdmKjQtFcMfhxnCTKf+miESq2igiKPHvPm2Q/R277si8A3y8K un+0x8TGqalcjfLFuCxHAcW2qNw91FZd/JD3n+/GHnGJNk7K08nFzFWqGQnagRI+lh9N RhCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PEc+Z5It; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id kx15-20020a170902f94f00b001b222cd9826si1014607plb.349.2023.10.31.06.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 06:52:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PEc+Z5It; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 0800980A97EC; Tue, 31 Oct 2023 06:51:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344665AbjJaNvw (ORCPT + 99 others); Tue, 31 Oct 2023 09:51:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344592AbjJaNvv (ORCPT ); Tue, 31 Oct 2023 09:51:51 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BAB3DE; Tue, 31 Oct 2023 06:51:48 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id D7CE16000C; Tue, 31 Oct 2023 13:51:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1698760306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lh/+wUApvt6UyuoxEjUcgfFXqmHXTrUff3SZed4i+ZQ=; b=PEc+Z5Itp+zlf1r7FsF2KO7B4aIZ1aW+icMbCRQbtwpEuvX1DiuPxQpdzD3T+9YDkuLaZc yfup0SWyCDs5LMWAZQgZGSEWw/1NWkZKPGqalzhxhBI7L+0VBW0GbFLd5pYqyP7Yg2AY0r lT1ZFOy2IhtZqcL0HyepYmIGFAsQB8IjZ4vEzLwHBnl0nPJUkatqcljXWBMLX+v3I+KqYh lyF5eB7C8DSGqjpFCd0XOHy3whIzaEG3bc0IvPzcwWxkfNMn+1PtPN2v1txMBe/b5K80hU lUdUE9TtbHMmieEj/IQXc1LEtXy40jQ/2p95fTYuf8BLS6xqOcz4OORODuJ66Q== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 31 Oct 2023 14:51:45 +0100 Subject: Re: [PATCH 6/6] tty: serial: amba-pl011: Parse bits option as 5, 6, 7 or 8 in _get_options Cc: "Hugo Villeneuve" , "Greg Kroah-Hartman" , "Jiri Slaby" , , , "Linus Walleij" , "Gregory CLEMENT" , "Alexandre Belloni" , "Thomas Petazzoni" , "Vladimir Kondratiev" , "Tawfik Bayouk" To: "Russell King (Oracle)" From: =?utf-8?q?Th=C3=A9o_Lebrun?= Message-Id: X-Mailer: aerc 0.15.2 References: <20231026-mbly-uart-v1-0-9258eea297d3@bootlin.com> <20231026-mbly-uart-v1-6-9258eea297d3@bootlin.com> <20231026105329.0ee9603563202bd2157a7d27@hugovil.com> In-Reply-To: X-GND-Sasl: theo.lebrun@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Tue, 31 Oct 2023 06:51:57 -0700 (PDT) On Tue Oct 31, 2023 at 12:22 PM CET, Russell King (Oracle) wrote: > On Tue, Oct 31, 2023 at 12:04:11PM +0100, Th=C3=A9o Lebrun wrote: > > On Tue Oct 31, 2023 at 11:11 AM CET, Russell King (Oracle) wrote: > > > There is no point in supporting 5 or 6 bits for console usage. Think > > > about it. What values are going to be sent over the console? It'll be > > > ASCII, which requires at _least_ 7-bit. 6-bit would turn alpha > > > characters into control characters, punctuation and numbers. 5-bit > > > would be all control characters. > > > > > > So there's no point trying to do anything with 5 or 6 bits per byte, > > > and I decided we might as well take that as an error (or maybe a > > > case that the hardware has not been setup) and default to 8 bits per > > > byte. > >=20 > > I see your point. Two things come to mind: > >=20 > > - I added this parsing of 5/6 bits to be symmetrical with > > pl011_set_termios that handles 5/6 properly. Should pl011_set_termio= s > > be modified then? > > Why should it? Note that I said above about _console_ usage which is > what you were referring to - the early code that sets up the console > by either reading the current settings (so that we can transparently > use the UART when its handed over already setup by a boot loader). > > This is completely different to what happens once the kernel is running. > Userspace might very well have a reason to set 5 or 6 bits if it wants > to communicate with a device that uses those sizes. > > However, such a device won't be a console for the reasons I outlined > above (it will truncate the ASCII characters turning console messages > into garbage.) I'm not sure I get it. (1) We assume it is a console so it's ASCII so no reason to set to 5 or 6 bits per word. But (2) there might be a reason to set the UART to 5 or 6 bits, the userspace decides. How do the two interact? Say we boot to Linux, userspace configures to 6 bits because reasons and we reset. At second probe we see a config of 6 bits per word but assume that can't be logical, even though it is. What makes us suppose at probe that it must be a console? I won't die on a hill for this topic; we'll go the way you prefer! Regards, -- Th=C3=A9o Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com