Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2619818pxb; Thu, 10 Feb 2022 01:30:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxNt90QzJF6E5w5QuElFMh9L9cg3p/wfrxvCaKDFof6mkpPVuh5Or+AVg52O6xDr7fgZAT X-Received: by 2002:a17:902:d4ca:: with SMTP id o10mr6509928plg.28.1644485435024; Thu, 10 Feb 2022 01:30:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644485435; cv=none; d=google.com; s=arc-20160816; b=ysc2szCqo+SdWfGe4AI2XdqfBF3ZpLHJzimIJ4ffa3ebbb2KMcUu8Meq3wb2GL0xwQ 9oZi49zT2wP/53f2BcyXFA1dgB32z3+tQzEJkkE98BYGMeuyE8uqbc01b/5mrtcEHUXL Ek5QFpSKfgebq0kM/W1QxzifNPKqO4mShAEImqjJSQVDURxxjQV1OAy6E6XLypsrBSCH 9IsqfeKdO/hd9/UwzCSRiDSZYDbA21Es3DORCxuC9k0dSKoK4q8M0um9YJLxs+Sq4FKX f1OguR3eaS+C1bf2gH2dj3NxJB3cgAbYMECxGG+qmloJGiV4OPm7sVuVoPgzSw3jwUer t4NQ== 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:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=DtwMzympNIAbb9jX/I+9H/b73pa8mz5O38XIKYpbJ9E=; b=jv82mAGH5ueY5Z04CulDK1PbhRhiR0swMEJC7oWqtTTUxsGrFgVPbflyYQqGNa2kPT YZxlOZjaeDkA0vejYF3yP8va8NA9y4EiGAdvPCGS0I/F9NZmDVpDOsjIHzY2Ab+OdFaj +XhIzI+PWcY2Y6hYSIX1/xPzDJZkdXRQ4a89QT48MxsxuEd/ihVgjbHBLoCRp4yNyi+o bcDCoxMYuAEfehUcjJ9J2NXIaSqnIOyPKoHKFL4LMDAfC6f+JaWomhXPLUm71jX0afNB Vm810liuTcz4xNirL29K5qdlvP9DRE3j0NiO7bJoKKw1dS59aEabkFaYRcif2Wtd7iQh I+dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GOJZjadx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a11si18141625pgi.308.2022.02.10.01.30.21; Thu, 10 Feb 2022 01:30:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GOJZjadx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S238226AbiBJJGe (ORCPT + 99 others); Thu, 10 Feb 2022 04:06:34 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238209AbiBJJGa (ORCPT ); Thu, 10 Feb 2022 04:06:30 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10BA4103B; Thu, 10 Feb 2022 01:06:32 -0800 (PST) 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 9D5F961148; Thu, 10 Feb 2022 09:06:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 052D6C004E1; Thu, 10 Feb 2022 09:06:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644483991; bh=dw0m8XTrE0jBvKEDbiMJbZ5WpKvYonnOY2hzYniSOFs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GOJZjadxXHWu0Y4NBBuoJL/gIMmJsQ8LyrehXC0FbVs74YCIpx5ojbTbWj3edfgUv dL8Iv4oMHUzdA05X5Rxu2ZYBuZ+wudLbaEpX62ClQxQDkpT5Zt2fb+dsJjMNNx2s4c c7Uh9hb/JAbeaK6cs40PaOaXqjKuye54U+m12cp5V74aDHvEDe9oe25ex5JiBEvvjc u4md3YauFMIgnaC5Clg8yoJ+KP+F0PNDTXw+LS5DhvGVXGcUgcgtWpH6DfuVfXMBO+ ufvuuJtih9RlL5vHoKRCmymRGBtfvZpnMv7PrfmdWUsvSkZfuTk1eWA5/2bt2PGkoQ BoV0WVyWKy7kw== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.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 1nI5PI-006rDU-Rr; Thu, 10 Feb 2022 09:06:28 +0000 Date: Thu, 10 Feb 2022 09:06:28 +0000 Message-ID: <87zgmz3xbf.wl-maz@kernel.org> From: Marc Zyngier To: Emil Renner Berthing Cc: Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Linus Walleij , Bartosz Golaszewski , Matthias Brugger , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Tony Lindgren , Thomas Gleixner , Vladimir Zapolskiy , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , kernel-team@android.com Subject: Re: [PATCH 10/10] pinctrl: starfive: Switch to dynamic chip name output In-Reply-To: References: <20220209162607.1118325-1-maz@kernel.org> <20220209162607.1118325-11-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 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kernel@esmil.dk, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linus.walleij@linaro.org, brgl@bgdev.pl, matthias.bgg@gmail.com, grygorii.strashko@ti.com, ssantosh@kernel.org, khilman@kernel.org, tony@atomide.com, tglx@linutronix.de, vz@mleia.com, andrew@lunn.ch, gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com, 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-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Wed, 09 Feb 2022 23:30:55 +0000, Emil Renner Berthing wrote: > > On Wed, 9 Feb 2022 at 17:49, Marc Zyngier wrote: > > > > Instead of overloading the name field, use the relevant callback to > > output the device name. > > > > Signed-off-by: Marc Zyngier > > --- > > drivers/pinctrl/pinctrl-starfive.c | 11 +++++++++-- > > 1 file changed, 9 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/pinctrl/pinctrl-starfive.c b/drivers/pinctrl/pinctrl-starfive.c > > index 5be9866c2b3c..f29d9ccf858b 100644 > > --- a/drivers/pinctrl/pinctrl-starfive.c > > +++ b/drivers/pinctrl/pinctrl-starfive.c > > @@ -15,6 +15,7 @@ > > #include > > #include > > #include > > +#include > > #include > > > > #include > > @@ -1163,12 +1164,20 @@ static int starfive_irq_set_type(struct irq_data *d, unsigned int trigger) > > return 0; > > } > > > > +static void starfive_irq_print_chip(struct irq_data *d, struct seq_file *p) > > +{ > > + struct starfive_pinctrl *sfp = starfive_from_irq_data(d); > > + > > + seq_printf(p, sfp->gc.label); > > +} > > + > > static struct irq_chip starfive_irq_chip = { > > .irq_ack = starfive_irq_ack, > > .irq_mask = starfive_irq_mask, > > .irq_mask_ack = starfive_irq_mask_ack, > > .irq_unmask = starfive_irq_unmask, > > .irq_set_type = starfive_irq_set_type, > > + .irq_print_chip = starfive_irq_print_chip, > > .flags = IRQCHIP_SET_TYPE_MASKED, > > }; > > The parent interrupt doesn't show up in /proc/interrupts anyway, so if > setting the name is considered abuse we can just drop the addition > above and just delete the two lines below. Are you sure this never appears? Is there a another irqchip stacked on top of this one? Could you please dump /sys/kernel/debug/irq/irqs/XX, where XX is an interrupt number using one of these GPIO pins? Please run it without this patch, as I just noticed that debugfs blindly uses the name. > The gpio framework seems to fill in default handlers in the struct > above, so unfortunately it can't yet be made const. Is this something > you intend to fix in the future? This is next on my list of things to address. The whole 'let's copy a whole irqchip structure and hijack random pointers' should not have happened, and it certainly is going to be an interesting ride. Thanks, M. -- Without deviation from the norm, progress is not possible.