[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<TYCPR01MB112691814D4D444C0CFB51C5186502@TYCPR01MB11269.jpnprd01.prod.outlook.com>
Date: Tue, 20 Feb 2024 12:10:02 +0000
From: Biju Das <biju.das.jz@...renesas.com>
To: Marc Zyngier <maz@...nel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
CC: Thomas Gleixner <tglx@...utronix.de>, Dmitry Baryshkov
<dmitry.baryshkov@...aro.org>
Subject: RE: [PATCH] genirq/irqdomain: Don't call ops->select for
DOMAIN_BUS_ANY tokens
Hi Marc Zyngier,
> -----Original Message-----
> From: Marc Zyngier <maz@...nel.org>
> Sent: Tuesday, February 20, 2024 11:48 AM
> Subject: [PATCH] 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()"), 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 <dmitry.baryshkov@...aro.org>
> Tested-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
> Reported-by: Biju Das <biju.das.jz@...renesas.com>
Tested-by: Biju Das <biju.das.jz@...renesas.com>
Cheers,
Biju
> Fixes: de1ff306dcf4 ("genirq/irqdomain: Remove the param count restriction
> from select()")
> Signed-off-by: Marc Zyngier <maz@...nel.org>
> Link:
> ---
> 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);
> --
> 2.39.2
Powered by blists - more mailing lists