From patchwork Tue Feb 20 11:47:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13563910 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 CDFE3C48BC4 for ; Tue, 20 Feb 2024 11:48:00 +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:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ftzNUEvM51FpqE8q5Gub2VGQ49iiCGwqQNWJrWhWsP4=; b=YdcHgBc5FBv/Ty rMV3K0c1JdDBciXOtVXb4hIC9RgLfwHONePYVXjYe2V8UzYr3ChmKYgGMcDPeHJW8u1ZaFdt1nUC9 XviD+wS8XxQcEuBnakZFnheYvwBQKrQSQ53bPBNMY66fZpfO8Q2T5QbXw2yLmcglVzEkn1+Ce5iYE wP56EY9kjSnnMsOZqzC869hJoRWLtYj8ynZuyrN12biJ3v//1qWo4qcR9oVaqv3I4iEHypqG4Yv4f sxnH08m8AlrZgN3Z0Wl6G9dD1jm5EzpuwpvyS0JEqTPmO/aU4HtNbKtaJC57vGq/3Z9H4tECO6Xu1 RQftdNdhMPeezdG5DUMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcObC-0000000EWNQ-3zTc; Tue, 20 Feb 2024 11:47:46 +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 1rcOb6-0000000EWLe-3IhX for linux-arm-kernel@lists.infradead.org; Tue, 20 Feb 2024 11:47:44 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id A5BABCE1821; Tue, 20 Feb 2024 11:47:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1E44C433F1; Tue, 20 Feb 2024 11:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708429656; bh=X+ZqMf3IK+JD8CFxWrUuIKFK5IZbu0of21KCXRE6D6E=; h=From:To:Cc:Subject:Date:From; b=RwjJmyhd5MtZxLjlIfA020w2JgutNuOVi8JavflhXQNUkW0ASaEuMKPPVU2U3bT/u 8R1bvicYO0Neszs6orB53+I4QoLqgl+6HBZqi7+FgNLMh8C6FEwIc2b+R5wsPBTZQ+ HkJgcOeUBQxNE4q4cfnmKCLdNx2Opo++bTU+XwEGp/AwmP8Tk5QDzE4Ytpt8DtBK0E ccL11a69TCSM+WO4jpotUS/hGns6oRHhd7q3WkkJaT//VOcI50khmBT8ZcdFIZwcPX GyOtLEVbBHD+FJQR+8BYnMAEkA+ZHM9kIjJcEI7fk90gdhm33w+EF2FTwtYRN4B+Wr HyK7x+FjSb5gA== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rcOb0-004u3X-H5; Tue, 20 Feb 2024 11:47:34 +0000 From: Marc Zyngier To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Thomas Gleixner , Dmitry Baryshkov , Biju Das Subject: [PATCH] genirq/irqdomain: Don't call ops->select for DOMAIN_BUS_ANY tokens Date: Tue, 20 Feb 2024 11:47:31 +0000 Message-Id: <20240220114731.1898534-1-maz@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tglx@linutronix.de, dmitry.baryshkov@linaro.org, biju.das.jz@bp.renesas.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-20240220_034741_078831_B2263E7F X-CRM114-Status: GOOD ( 14.29 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Users of the IRQCHIP_PLATFORM_DRIVER_{BEGIN,END} helpers rely on a fwspec containing only the fwnode (and crucially a number of parameters set to 0) together with a DOMAIN_BUS_ANY token to check whether a parent irqchip has probed and registered a domain. Since de1ff306dcf4 ("genirq/irqdomain: Remove the param count restriction from select()"), we call ops->select unconditionally, meaning that irqchips implementing select now need to handle ANY as a match. Instead of adding more esoteric checks to the individual drivers, add that condition to irq_find_matching_fwspec(), and let it handle the corner case, as per the comment in the function. This restores the functionnality of the above helpers. Reported-by: Dmitry Baryshkov Tested-by: Dmitry Baryshkov Reported-by: Biju Das Fixes: de1ff306dcf4 ("genirq/irqdomain: Remove the param count restriction from select()") Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20240219-gic-fix-child-domain-v1-1-09f8fd2d9a8f@linaro.org Tested-by: Biju Das Signed-off-by: Thomas Gleixner Tested-by: Borislav Petkov (AMD) Reviewed-by: Marc Zyngier --- kernel/irq/irqdomain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);