[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <170844679345.398.17551290253758129895.tip-bot2@tip-bot2>
Date: Tue, 20 Feb 2024 16:33:13 -0000
From: "tip-bot2 for Marc Zyngier" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Biju Das <biju.das.jz@...renesas.com>, Marc Zyngier <maz@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: irq/msi] genirq/irqdomain: Don't call ops->select for
DOMAIN_BUS_ANY tokens
The following commit has been merged into the irq/msi branch of tip:
Commit-ID: 5aa3c0cf5bba6437c9e63a56f684f61de8b503d6
Gitweb: https://git.kernel.org/tip/5aa3c0cf5bba6437c9e63a56f684f61de8b503d6
Author: Marc Zyngier <maz@...nel.org>
AuthorDate: Tue, 20 Feb 2024 11:47:31
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Tue, 20 Feb 2024 17:30:57 +01:00
genirq/irqdomain: Don't call ops->select for DOMAIN_BUS_ANY tokens
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()"), ops->select() is called 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 functionality of the above helpers.
Fixes: de1ff306dcf4 ("genirq/irqdomain: Remove the param count restriction from select()")
Reported-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
Reported-by: Biju Das <biju.das.jz@...renesas.com>
Signed-off-by: Marc Zyngier <maz@...nel.org>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
Tested-by: Biju Das <biju.das.jz@...renesas.com>
Link: https://lore.kernel.org/r/20240220114731.1898534-1-maz@kernel.org
Link: https://lore.kernel.org/r/20240219-gic-fix-child-domain-v1-1-09f8fd2d9a8f@linaro.org
---
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 aeb4165..3dd1c87 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);
Powered by blists - more mailing lists