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 48ABBC48BF8 for ; Mon, 19 Feb 2024 15:54:07 +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=W7a8XT//PSM4rweqUSePqKvhcfazwP6N2xPipQU9DqA=; b=2BcfievnAowJBm b03neeB4eqhhDSbFi/FVsKwa3MItN/oMCoUHAMnm4bBG5PQSX67PhWJbDXWQ8tXKX12DNEy6gv3Ru bMSYZNa8sU1i6s6gwT5f0NG+bFWE47wTA4TGHgbsm/nd5Z5yEEfTFFqK5a/PqnXl1qwiN6exxXcnL RIZ8xVyVVsN6mwbhm3xadxziCD5aDNFazRd+agiL8bQQbK9lfiNxqREmHWBBg292twQHtLARga2xX oN4g+CxEiAg02ns3+5TkJ2kbyqnXhQ801wtyb82YIjVfNnDheLqNIAIIHdDHJ3sPvie6tNqYsdHT3 jGp6f38iEzSKDeAp/l0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rc5xu-0000000BDHz-1U3M; Mon, 19 Feb 2024 15:53:58 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rc5xr-0000000BDHL-29BB for linux-arm-kernel@lists.infradead.org; Mon, 19 Feb 2024 15:53:57 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 62FEFCE12DD; Mon, 19 Feb 2024 15:53:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1D53C43390; Mon, 19 Feb 2024 15:53:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708358030; bh=517fO3sYzhBoS+A0/0syTbcWUfDqWRHc0TLYK++SB58=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=s9vTbW1Zb4232ZNMuGkskRATSlx/9DIk6EfIbOERpQ8wfVwMybokX2cKqwlst5k3s /wZn4awaQpLjSjlE3xEeenjMDR0dcHanOaS6euffCUGFVUJTCbXieWC2CbkLUY7Jbt gtfATQZS2FDZj+VvvE+Rbyu8DLqMo8RKeHo4/pSmbqAeuKqSUuQJci+wXv6CDkUwlX CyaQIaLsPqW3PnGTTvOZe+OLq0N0K3RroZG1LBviYsaclgy4qRxOaIVO8hmJ/vX8o8 h6Dsg3AdOR3jPNmSMQtHQeIunm3GFunpTkuDe0rpSpT8AvEml40Im6NYF1qgWqHVfj f7slrWgzTUg5w== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.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 1rc5xk-004crN-Hc; Mon, 19 Feb 2024 15:53:48 +0000 Date: Mon, 19 Feb 2024 15:53:48 +0000 Message-ID: <868r3g4fhv.wl-maz@kernel.org> From: Marc Zyngier To: Dmitry Baryshkov Cc: Thomas Gleixner , Anup Patel , Konrad Dybcio , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH] irqchip/gic-v3: handle DOMAIN_BUS_ANY in gic_irq_domain_select In-Reply-To: <20240219-gic-fix-child-domain-v1-1-09f8fd2d9a8f@linaro.org> References: <20240219-gic-fix-child-domain-v1-1-09f8fd2d9a8f@linaro.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/29.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: dmitry.baryshkov@linaro.org, tglx@linutronix.de, apatel@ventanamicro.com, konrad.dybcio@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240219_075355_923555_297533DB X-CRM114-Status: GOOD ( 29.66 ) 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 Mon, 19 Feb 2024 14:47:37 +0000, Dmitry Baryshkov wrote: > > Before the commit de1ff306dcf4 ("genirq/irqdomain: Remove the param > count restriction from select()") the irq_find_matching_fwspec() was > handling the DOMAIN_BUS_ANY on its own. After this commit it is a job of > the select() callback. However the callback of GICv3 (even though it got > modified to handle zero param_count) wasn't prepared to return true for > DOMAIN_BUS_ANY bus_token. > > This breaks probing of any of the child IRQ domains, since > platform_irqchip_probe() uses irq_find_matching_host(par_np, > DOMAIN_BUS_ANY) to check for the presence of the parent IRQ domain. > > Fixes: 151378251004 ("irqchip/gic-v3: Make gic_irq_domain_select() robust for zero parameter count") > Fixes: de1ff306dcf4 ("genirq/irqdomain: Remove the param count restriction from select()") > Signed-off-by: Dmitry Baryshkov > --- > drivers/irqchip/irq-gic-v3.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c > index 6fb276504bcc..e9e9643c653f 100644 > --- a/drivers/irqchip/irq-gic-v3.c > +++ b/drivers/irqchip/irq-gic-v3.c > @@ -1696,7 +1696,8 @@ static int gic_irq_domain_select(struct irq_domain *d, > > /* Handle pure domain searches */ > if (!fwspec->param_count) > - return d->bus_token == bus_token; > + return d->bus_token == bus_token || > + bus_token == DOMAIN_BUS_ANY; > > /* If this is not DT, then we have a single domain */ > if (!is_of_node(fwspec->fwnode)) > I really dislike the look of this. If that's the case, any irqchip that has a 'select' method (such as imx-intmux) should be similarly hacked. And at this point, this should be handled by the core code. Can you try this instead? I don't have any HW that relies on behaviour, but I'd expect this to work. Thanks, M. diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index aeb41655d6de..3dd1c871e091 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -449,7 +449,7 @@ struct irq_domain *irq_find_matching_fwspec(struct irq_fwspec *fwspec, */ mutex_lock(&irq_domain_mutex); list_for_each_entry(h, &irq_domain_list, link) { - if (h->ops->select) + if (h->ops->select && bus_token != DOMAIN_BUS_ANY) rc = h->ops->select(h, fwspec, bus_token); else if (h->ops->match) rc = h->ops->match(h, to_of_node(fwnode), bus_token); -- 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