From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9B961C433F5 for ; Sat, 26 Feb 2022 10:33:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=keixm5cvk38TDXQncmZlO9TCn1dpzRXI/BmVzbr0JJw=; b=LsU6za1df0UBfQ Ll/aqfL53vX4NcN8nmlmryyjVaa1OwAa7o3CI4a/Y8j1xTWLFo818OMLD8/FzWBzcbG3jaEyWTqen bMCQqy8BKdNTANuBRGxTU2HCz3yBA5vTrdU03RKi/v6WeGDsUZuJkpKPX9hROVuIxVR164N5KzXu/ CenMz8AetPKpZ21y1kjRJCNnY37lAIJKvZhF9Xkd2i4L2rb2vN2xVEWsBlTzoKTeV7kpiFOELaZAh UoTh0klmhlDQWxJXspb2w1IRkCiRwyOFLJD/rUoDfSFZh1+ULrG34/gj7kx8yiWWDg+6X/ZBRX/iq Xi9QNZwOg9MpGbH27FxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNuNC-007u98-1W; Sat, 26 Feb 2022 10:32:22 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNuN8-007u8i-Iu for linux-arm-kernel@lists.infradead.org; Sat, 26 Feb 2022 10:32:20 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 12F7E60F86; Sat, 26 Feb 2022 10:32:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D2B0C340E8; Sat, 26 Feb 2022 10:32:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645871537; bh=J/i1dumb0mZxElEmXwi6DbevV9tFlTtn/ahQ4gUjGfM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VQ3sc0i4kFjee2QupZiMhQ0MpUFtnztiKVXCqH6ohlwYJO3Y9R0aSnIM7GaMEwKaB f+agBQMCQOA1Q8k89ExF3VN8x+K3f4q/o6pmpuA3iBde2QpfIBnIprRpqNupmUOsHG pijwu7HidrvZ0jjNXU8KI+V7NBsyVsnwcPFmGA3Xanjtaaal3ofgJJUBln54k4xGIt TBNjwan1XrIk1/gCxSmxeckO1J7Wa5kd2vERWoMWpOxoVg/IugU4ThUryaKGgCh2H3 XlKGa1cNeogu0rK+2V2V0Bu2dsMQeJcZkccYQeMlF06supyUhMSafincETd5TtVsq6 hrrp3uGFZE/Cg== Received: from sofa.misterjones.org ([185.219.108.64] helo=billy-the-mountain.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nNuN5-00AimC-3q; Sat, 26 Feb 2022 10:32:15 +0000 Date: Sat, 26 Feb 2022 10:32:10 +0000 Message-ID: <877d9h7wb9.wl-maz@kernel.org> From: Marc Zyngier To: Thierry Reding Cc: linux-kernel@vger.kernel.org, Linus Walleij , Bartosz Golaszewski , Joey Gouly , Jonathan Hunter , Hector Martin , Sven Peter , Alyssa Rosenzweig , Bjorn Andersson , Andy Gross , Thomas Gleixner , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH 1/5] gpio: Don't fiddle with irqchips marked as immutable In-Reply-To: References: <20220223154405.54912-1-maz@kernel.org> <20220223154405.54912-2-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: thierry.reding@gmail.com, linux-kernel@vger.kernel.org, linus.walleij@linaro.org, brgl@bgdev.pl, joey.gouly@arm.com, jonathanh@nvidia.com, marcan@marcan.st, sven@svenpeter.dev, alyssa@rosenzweig.io, bjorn.andersson@linaro.org, agross@kernel.org, tglx@linutronix.de, linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220226_023218_737428_7C59C5FF X-CRM114-Status: GOOD ( 34.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 24 Feb 2022 16:51:41 +0000, Thierry Reding wrote: > > On Wed, Feb 23, 2022 at 03:44:01PM +0000, Marc Zyngier wrote: > > In order to move away from gpiolib messing with the internals of > > unsuspecting irqchips, add a flag by which irqchips advertise > > that they are not to be messed with, and do solemnly swear that > > they correctly call into the gpiolib helpers wueh required. > > > > Signed-off-by: Marc Zyngier > > --- > > drivers/gpio/gpiolib.c | 7 ++++++- > > include/linux/irq.h | 2 ++ > > kernel/irq/debugfs.c | 1 + > > 3 files changed, 9 insertions(+), 1 deletion(-) > > I kind of like this. The bit where the const cast is essentially guarded > by an "immutable" flag is a bit funky, but it doesn't look like there is > a good way to do it by making all references const without doing a huge > all-at-once conversion. Exactly. Somehow, we need to advertise it to the gpiolib code, and this does the job. I hope to be able to simply drop it once everthing is converted. One day. > I've always found it a bit irritating that irq_chip was somewhere > between a container for chip-specific data and an "ops" structure. I > think it'd be even nicer if this was split into an extra struct > irq_chip_ops, which could then always be const and a struct irq_chip > that contained primarily chip-specific data as well as a pointer to > struct irq_chip_ops. But that's the thing: it almost is a pure 'ops' structure. Only two things are getting in the way of it: - the 'parent_dev' field: this is now sorted, as I moved it to the irq_domain structure, and updated all the relevant drivers (see what is currently in -next). - the .name field: it really should never be something that changes from one instance of the chip to another. Which is why we have the .irq_print_chip() method to handle that (and ideally we'd stick to pure const names). I'm addressing this as I go, but everything in drivers/irqchip/ should be fixed in -next. The "context" part really lives in irq_domain. > But again, this seems fairly tricky to pull off given all the > interdependencies and we can iterate on this in the future, so this > seems like a good enough compromise: > > Acked-by: Thierry Reding Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel