Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4467560imw; Tue, 12 Jul 2022 08:25:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sua9cCAVQgXCHmifsVsQ+5cQQuCHFitB86Tv/THnPdzbltk1iRY8YaQi8dWH86Bke6C8Rc X-Received: by 2002:a17:907:2d86:b0:72b:4aee:7729 with SMTP id gt6-20020a1709072d8600b0072b4aee7729mr13536379ejc.143.1657639523358; Tue, 12 Jul 2022 08:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657639523; cv=none; d=google.com; s=arc-20160816; b=PQJzNSmupkEIa+9wWHxgxgZsD8z4CamNh7EYZ9LWLHFZAkPTk4qyWVUqWXZRhPsB0d Mu80o01MeFRMEeeyFo315pJCd1I9oCFFb5RMuC1ZFQkUtx8/7vsQI9Hial8xcgclLJ8x 4OM5vBR5wIDMGkOVBrZ1172zrmxDc5191bo3t48pP6ppPB9+Y1xaZmRGBXXaEC48pO1k A9DfkaWbPssUL67LOwkpCXjxaEKcwWo/rnsBHcuhRrYHdWYP362GA8/fLBX7aEeqmbbp rbWx4g68EUbiyJJZHHs1E48IkpiDzJdqMSjAmTfe4a6faTH7JEZgN4pGkMuAcEFCAhvY 630A== 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=Q9fYl/jiJplkxQXrST/Ottcby8m7kpQnJzw0hEeTl1A=; b=zKp6O8//0VLXqkOvM2sAWwGYp8NJ+b0EhjgLFryUNtCSaDyT5RXmjia2vBH1K4rGN6 SChBQ43xM74O9+/PRK+5PI4FbzVy4kD6TL+jbyKGS3i1fwr15uy/Ww2fKQG4TKZBZ8Cc XggiMpRzUqguC3q7sjB3KBQANIcr3zkqSiDuY5OWPn+VrKUYMarmbRbzbnt8YzCGZYT1 qOAln2Rq9EIJYSEyGGH7f1LCvfJaNOd41hLyNB81SpUiVl1rSYd2lCrkCMtd2S8o4e35 dCsmL6Frx3AuJ+vDhyWOUwa1EHtb4SGC4X8HP0eYujPhTeCNxv7SRpiKwAFU6OEgug/l Z8/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HWb2gLVi; 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 ej9-20020a056402368900b0043a7cdfac47si14353997edb.251.2022.07.12.08.24.58; Tue, 12 Jul 2022 08:25:23 -0700 (PDT) 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=HWb2gLVi; 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 S231164AbiGLPRh (ORCPT + 99 others); Tue, 12 Jul 2022 11:17:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230327AbiGLPRR (ORCPT ); Tue, 12 Jul 2022 11:17:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D53CCB470; Tue, 12 Jul 2022 08:12:12 -0700 (PDT) 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 BD52861646; Tue, 12 Jul 2022 15:12:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24646C341CF; Tue, 12 Jul 2022 15:12:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657638731; bh=C/YAeZwDaigaxiGNOsANIwwPCDhFaElCOC+xb+Ncslk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HWb2gLVikJ2R3JWQl05H9QpB8Mi+R9RhrTLs8tlLOCG6eALoEp0LFYgosDp6xjgM+ iKkcQT5kUPROff/siuM/sYJqQDd1JgAE6329DzyjTJ0xnfP5jAvTrQcxrP5Go6S7zv 94Mlqb1HzV78jipvmYjXs/oJQJ1XAuT58RVSiqSv4bW5tGO7RU0LHYHgKtfFNjlnq6 7Fhs4dVeqSlSmEN+V/XSKzrHrVjqiiKhOQgDNmFhflniVkV5ZHj4gzdVvjhMO/6rt/ KkGr3QGfkzAL7LxVJ82exaHypl9vOihtC1eC4OztNb9wy2PttwFGSdx0mbcONDqK2R qpb5OdVoSSevw== 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.95) (envelope-from ) id 1oBHYW-006yUs-Nt; Tue, 12 Jul 2022 16:12:08 +0100 Date: Tue, 12 Jul 2022 16:12:08 +0100 Message-ID: <87czea1i2f.wl-maz@kernel.org> From: Marc Zyngier To: Manivannan Sadhasivam Cc: Robert Marko , bjorn.andersson@linaro.org, agross@kernel.org, linus.walleij@linaro.org, linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pinctrl: qcom: spmi-gpio: make the irqchip immutable In-Reply-To: <20220712124445.GC21746@workstation> References: <20220624195112.894916-1-robimarko@gmail.com> <87edyq1ujr.wl-maz@kernel.org> <20220712124445.GC21746@workstation> 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: manivannan.sadhasivam@linaro.org, robimarko@gmail.com, bjorn.andersson@linaro.org, agross@kernel.org, linus.walleij@linaro.org, linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org 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.7 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 Tue, 12 Jul 2022 13:44:45 +0100, Manivannan Sadhasivam wrote: > > On Tue, Jul 12, 2022 at 11:42:32AM +0100, Marc Zyngier wrote: > > On Fri, 24 Jun 2022 20:51:12 +0100, > > Robert Marko wrote: > > > > > > Commit 6c846d026d49 ("gpio: Don't fiddle with irqchips marked as > > > immutable") added a warning to indicate if the gpiolib is altering the > > > internals of irqchips. > > > > > > Following this change the following warning is now observed for the SPMI > > > PMIC pinctrl driver: > > > gpio gpiochip1: (200f000.spmi:pmic@0:gpio@c000): not an immutable chip, please consider fixing it! > > > > > > Fix this by making the irqchip in the SPMI PMIC pinctrl driver immutable. > > > > > > Signed-off-by: Robert Marko > > > --- > > > drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 22 ++++++++++++---------- > > > 1 file changed, 12 insertions(+), 10 deletions(-) > > > > > > diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > > > index c3255b0bece4..406ee0933d0b 100644 > > > --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > > > +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > > > @@ -171,7 +171,6 @@ struct pmic_gpio_state { > > > struct regmap *map; > > > struct pinctrl_dev *ctrl; > > > struct gpio_chip chip; > > > - struct irq_chip irq; > > > u8 usid; > > > u8 pid_base; > > > }; > > > @@ -988,6 +987,17 @@ static void *pmic_gpio_populate_parent_fwspec(struct gpio_chip *chip, > > > return fwspec; > > > } > > > > > > +static const struct irq_chip spmi_gpio_irq_chip = { > > > + .name = "spmi-gpio", > > > + .irq_ack = irq_chip_ack_parent, > > > + .irq_mask = irq_chip_mask_parent, > > > + .irq_unmask = irq_chip_unmask_parent, > > > > No, this is wrong. Please look at the documentation to see how you > > must now directly call into the gpiolib helpers for these two > > callbacks. > > > > IIUC, you are referring to gpiochip_disable_irq() and > gpiochip_enable_irq() APIs. I am indeed. > These APIs are supposed to let the gpiolib know about that the IRQ > usage of these GPIOs. But for the case of hierarchial IRQ domain, > isn't the parent is going to do that? Why would it? The parent has no clue about what sits above it. In a hierarchical configuration, each level is responsible for its own level, and the GPIO layer should be responsible for its own management. > Please correct me if I'm wrong. I'm afraid you are, and this patch is a fairly obvious change in behaviour, as the callbacks you mention above are not called anymore, while they were before. If they are not necessary (for reasons I can't fathom), then this should be clearly explained. Thanks, M. -- Without deviation from the norm, progress is not possible.