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 X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DC14C4338F for ; Wed, 18 Aug 2021 09:34:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0010D60462 for ; Wed, 18 Aug 2021 09:34:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233786AbhHRJeq (ORCPT ); Wed, 18 Aug 2021 05:34:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:60290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233145AbhHRJbk (ORCPT ); Wed, 18 Aug 2021 05:31:40 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A0B1460462; Wed, 18 Aug 2021 09:31:06 +0000 (UTC) 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 1mGHua-005iO1-Os; Wed, 18 Aug 2021 10:31:04 +0100 Date: Wed, 18 Aug 2021 10:31:04 +0100 Message-ID: <87tujnrtev.wl-maz@kernel.org> From: Marc Zyngier To: Maulik Shah Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, bjorn.andersson@linaro.org, linus.walleij@linaro.org, tkjos@google.com, lsrao@codeaurora.org Subject: Re: [PATCH 2/2] irqchip: qcom-pdc: Disconnect domain hierarchy for GPIO_NO_WAKE_IRQs In-Reply-To: <1629195546-27811-2-git-send-email-mkshah@codeaurora.org> References: <1629195546-27811-1-git-send-email-mkshah@codeaurora.org> <1629195546-27811-2-git-send-email-mkshah@codeaurora.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: mkshah@codeaurora.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, bjorn.andersson@linaro.org, linus.walleij@linaro.org, tkjos@google.com, lsrao@codeaurora.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maulik, In the future, please always add a cover-letter email if sending a series that has more than a single patch. This considerably helps the tracking, and gives you an opportunity to explain what you are doing. On Tue, 17 Aug 2021 11:19:06 +0100, Maulik Shah wrote: > > gpio_to_irq() reports error at irq_domain_trim_hierarchy() for non wakeup > capable GPIOs that do not have dedicated interrupt at GIC. > > Since PDC irqchip do not allocate irq at parent GIC domain for such GPIOs > indicate same by using irq_domain_disconnect_hierarchy(). > > Signed-off-by: Maulik Shah > --- > drivers/irqchip/qcom-pdc.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c > index 32d5920..0ba0461 100644 > --- a/drivers/irqchip/qcom-pdc.c > +++ b/drivers/irqchip/qcom-pdc.c > @@ -324,8 +324,11 @@ static int qcom_pdc_gpio_alloc(struct irq_domain *domain, unsigned int virq, > if (ret) > return ret; > > - if (hwirq == GPIO_NO_WAKE_IRQ) > + if (hwirq == GPIO_NO_WAKE_IRQ) { > + if (domain->parent) > + irq_domain_disconnect_hierarchy(domain->parent, virq); > return 0; > + } > > parent_hwirq = get_parent_hwirq(hwirq); > if (parent_hwirq == PDC_NO_PARENT_IRQ) It feels like you are papering over the core of the problem, which is that most of the GPIO_NO_WAKE_IRQ stuff should simply go away now that we have a way to drop parts of the hierarchy. I had a go at that a few months back, but never had the opportunity to actually test the resulting code[1]. Could you please give it a go and let me know what breaks? Thanks, M. [1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?h=irq/qcom-pdc-nowake&id=331b2ba388a4a79b5c40b8addf56cbe35099a410 -- Without deviation from the norm, progress is not possible.