Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4735594rdb; Fri, 15 Sep 2023 10:37:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGph46KvaeFunbUTWWs48hUDcVpmdYRu8wrSDuMNd2pdrSMmQLwwLie3+NM+P5QuzWIxGwk X-Received: by 2002:a17:90a:7449:b0:268:f45:c10a with SMTP id o9-20020a17090a744900b002680f45c10amr2234767pjk.26.1694799426910; Fri, 15 Sep 2023 10:37:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694799426; cv=none; d=google.com; s=arc-20160816; b=ov9b9mYowQgcV110/9QQXlpiPL0XlEtv2OUXKAUTDiYw7jmekA8fwdgwKR8bgg3PAh Z3uN1KAGoJhx99A6D9z29l77zyZkOGqNcykoGUQxJhyG+YgAdL6iiXYRY6d7e2O7xh+/ l+63njCDjUKAxpavedc68tzw6W1pUBs14U8lDDh3plLzTfoLWI5wlhvUNyOB1THxftO4 rCz8f2nqWgP7SAXmFQYOzlwNMBUl+uIzf8/exMT+u+XATLQD4Rx+vGeJFfDeW6kBfiV3 gBsgUev0qdqzR/A71xEnzW4OjB+2OnySv6ZpahDSKOodch4pNnmTzV4BVERPf41pJ7kW j0EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=E4MOPKD0DcFEhD0XeOi62cBHXESMxU1TcXFWDpR7ras=; fh=XisXMsFTCRvfKSpam3KX+tHmNl/bF7/vZzChNRIs3sQ=; b=0y4/YRrblz5TRuY9ikgWxvZm2vW7y012giiecLKphZImzLeyQS+6p7c9JBgS/8WVxj TF4mlB0L8cqevVz6dbpADzHLGShrM3zM4QT/dSC+V8f1MDPA6pzVcowisnwNCX4b3wfW CiJICfYWoS2rr5wrid7eeiiKcBwgCQlIrB/cVFlhB+sWsKe6BXDUAzSaQ2eFnTf+PaAU 8jGOkPt45o/t4FFmX3D9hMfdZn/3zpwuwHOa3m4zLiBK/lyAqUM4iqypk1j2+0WTLIGJ B9PMrR1XEAwEyaCABibANdUa9C+reHo0mvHBGVMkf6NKbRGX9bygClvpkE4ZF9adxkrb l7dA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id l3-20020a17090ac58300b0026b7bee6873si5865566pjt.112.2023.09.15.10.37.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 10:37:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6BBFE836E03E; Fri, 15 Sep 2023 10:24:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235732AbjIORYW (ORCPT + 99 others); Fri, 15 Sep 2023 13:24:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235618AbjIORXx (ORCPT ); Fri, 15 Sep 2023 13:23:53 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8CEA610F7 for ; Fri, 15 Sep 2023 10:23:47 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 09EFA92009D; Fri, 15 Sep 2023 19:23:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 03E9292009C; Fri, 15 Sep 2023 18:23:44 +0100 (BST) Date: Fri, 15 Sep 2023 18:23:44 +0100 (BST) From: "Maciej W. Rozycki" To: Thomas Gleixner cc: John Ogness , Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, Petr Mladek , linux-kernel@vger.kernel.org, Tobias Klauser , Thierry Reding , Joel Stanley , Andrew Jeffery , linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, Al Cooper , Broadcom internal kernel review list , Tony Lindgren , Andy Shevchenko , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Florian Fainelli , Andrew Davis , Matthew Howell , =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= , Johan Hovold , Matthias Brugger , AngeloGioacchino Del Regno , Chen-Yu Tsai , linux-mediatek@lists.infradead.org, Lukas Wunner , Matthias Schiffer , Arnd Bergmann , Kumaravel Thiagarajan , Tharun Kumar P , Russell King , Hongyu Xie , Jiamei Xie , Rob Herring , delisun , Lino Sanfilippo , Yangtao Li , Vineet Gupta , linux-snps-arc@lists.infradead.org, Richard Genoud , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Arend van Spriel , Christophe Leroy , Baruch Siach , Sherry Sun , Shenwei Wang , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Sergey Organov , Tom Rix , Marek Vasut , Karol Gugala , Mateusz Holenko , Gabriel Somlo , Vladimir Zapolskiy , Jacky Huang , Shan-Chun Hung , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Dmitry Rokosov , Lucas Tanure , linux-amlogic@lists.infradead.org, Taichi Sugaya , Takao Orito , Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi , Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, =?UTF-8?Q?Pali_Roh=C3=A1r?= , Andrew Morton , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , linux-actions@lists.infradead.org, Xiongfeng Wang , Yuan Can , Michael Ellerman , Nicholas Piggin , linuxppc-dev@lists.ozlabs.org, linux-unisoc@lists.infradead.org, Kevin Cernekee , Krzysztof Kozlowski , Alim Akhtar , linux-samsung-soc@vger.kernel.org, Lukas Bulwahn , Lech Perczak , Hugo Villeneuve , Andy Shevchenko , Isaac True , Laxman Dewangan , Thierry Reding , Jonathan Hunter , linux-tegra@vger.kernel.org, Biju Das , Geert Uytterhoeven , Palmer Dabbelt , Paul Walmsley , Nick Hu , Ruan Jinjie , Samuel Holland , linux-riscv@lists.infradead.org, Orson Zhai , Baolin Wang , Chunyan Zhang , Patrice Chotard , Maxime Coquelin , Alexandre Torgue , Valentin Caron , Sebastian Andrzej Siewior , linux-stm32@st-md-mailman.stormreply.com, "David S. Miller" , sparclinux@vger.kernel.org, Hammer Hsieh , Timur Tabi , Mukesh Ojha , =?UTF-8?Q?Jonathan_Neusch=C3=A4fer?= , Michal Simek Subject: Re: [PATCH tty v1 00/74] serial: wrappers for uart port lock In-Reply-To: <87il8b1w3l.ffs@tglx> Message-ID: References: <20230914183831.587273-1-john.ogness@linutronix.de> <87il8b1w3l.ffs@tglx> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 15 Sep 2023 10:24:48 -0700 (PDT) On Fri, 15 Sep 2023, Thomas Gleixner wrote: > >> Patches 2-74 switch all uart port locking call sites to use the new > >> wrappers. These patches were automatically generated using coccinelle. > > > > Hmm, no need to do this for drivers/tty/serial/zs.c? > > zs.c does not use port lock at all. It has like a couple of other > drivers a local homebrewn spinlock. Ah, right, that's because there are registers shared between two ports within one SCC, so the spinlock has to be shared as well. This also indicates that dz.c is wrong and shouldn't be using a per-port spinlock as the DZ has a shared register set between all the four ports (it's a serial line multiplexer rather than a set discrete ports; up to 8 lines are architecturally supported, though we don't have support in Linux for systems having those), e.g. there's only one 16-bit receiver buffer register for all the four ports, supplying the 8-bit character received along with the receive status and the number of the line this data arrived on, and similarly there's only one transmit data register, which supplies data to the next enabled line whose transmit buffer needs servicing, and the chip routes the data itself. Therefore the driver ought to use a shared spinlock too. I guess it wasn't noticed so far because DZ devices aren't that common (and my usual test machine is currently broken too, pending an SRAM chip replacement, hopefully in the next few weeks) and then hardly ever more than one serial line has been used at a time with these devices. It looks like the first issue for me to look into once the machine has been fixed. Maybe dz.c shouldn't be touched by this series then? (Though obviously both drivers will have to be eventually adapted for the ultimate console rework.) Thanks for your input, as it turns out it has had an unexpected outcome. Maciej