Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Eliav Farber" <farbere@amazon.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v5 5/9] irqchip/al-fic: switch to shared parent interrupt
Date: Sun, 11 Oct 2026 05:14:45 +0000	[thread overview]
Message-ID: <sashiko-outbox-167032@kernel.org> (raw)
In-Reply-To: <20261011050449.41903-6-farbere@amazon.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] irqchip/al-fic: shared parent mapping destroyed on error path via irq_dispose_mapping
--

commit 2575228eb0e3f9536c071e11d0536822135b2cae
Author: Eliav Farber <farbere@amazon.com>

irqchip/al-fic: switch to shared parent interrupt

This commit changes the driver from using a chained handler to a shared
interrupt (IRQF_SHARED) for the parent interrupt line. This change allows
multiple FIC groups to share a single output line toward the parent GIC SPI.
It also seeds the mask cache from the hardware register before requesting
the interrupt.

> diff --git a/drivers/irqchip/irq-al-fic.c b/drivers/irqchip/irq-al-fic.c
> index 32d8098699a41..8a7eb9009515f 100644
> --- a/drivers/irqchip/irq-al-fic.c
> +++ b/drivers/irqchip/irq-al-fic.c
[ ... ]
> @@ -162,9 +165,22 @@ static int al_fic_register(struct device_node *node,
>  	gc->chip_types->chip.flags = IRQCHIP_SKIP_SET_WAKE;
>  	gc->private = fic;
>  
> -	irq_set_chained_handler_and_data(fic->parent_irq,
> -					 al_fic_irq_handler,
> -					 fic);
> +	/*
> +	 * Seed the mask cache with the value al_fic_wire_init() programmed,
> +	 * rather than having the generic chip read the register back on the
> +	 * first child mapping: that is later than the parent is requested, and
> +	 * never happens at all for a group with no consumer in the devicetree.
> +	 */
> +	gc->mask_cache = ~0U;
> +
> +	ret = request_irq(fic->parent_irq, al_fic_irq_handler,
> +			  IRQF_NO_THREAD | IRQF_SHARED,
> +			  of_node_full_name(fic->node), fic);
> +	if (ret) {
> +		pr_err("fail to request irq (%d)\n", ret);
> +		goto err_domain_remove;
> +	}

[Severity: High]
Will this transition to a shared parent interrupt cause issues with the
error path in al_fic_init_dt()?

Since multiple FIC groups can now share the same parent interrupt, if a
subsequent group fails initialization (e.g. if this request_irq() fails),
al_fic_init_dt() will call irq_dispose_mapping(parent_irq):

drivers/irqchip/irq-al-fic.c:al_fic_init_dt() {
    ...
    fic = al_fic_wire_init(node, base, parent_irq);
    if (IS_ERR(fic)) {
        pr_err("%pOF: fail to initialize irqchip (%pe)\n", node, fic);
        ret = PTR_ERR(fic);
        goto err_irq_dispose;
    }

    return 0;

err_irq_dispose:
    irq_dispose_mapping(parent_irq);
    ...
}

Because Linux IRQ mappings are not natively reference-counted at the dispose
level, unconditionally unmapping the shared parent interrupt would sever
interrupts for any other FIC instances that already successfully requested
and mapped this shared parent line.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261011050449.41903-1-farbere@amazon.com?part=5

  reply	other threads:[~2026-10-11  5:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11  5:04 [PATCH v5 0/9] irqchip/al-fic: shared parent IRQ, error/fatal outputs and affinity Eliav Farber
2026-10-11  5:04 ` [PATCH v5 1/9] irqchip/al-fic: fix argument alignment and a repeated word Eliav Farber
2026-10-11  5:04 ` [PATCH v5 2/9] irqchip/al-fic: use %pe to print init error Eliav Farber
2026-10-12 18:42   ` Radu Rendec
2026-10-11  5:04 ` [PATCH v5 3/9] irqchip/al-fic: use %pOF and raise init log level Eliav Farber
2026-10-11  5:04 ` [PATCH v5 4/9] irqchip/al-fic: keep the device_node instead of a cached name string Eliav Farber
2026-10-12 18:53   ` Radu Rendec
2026-10-11  5:04 ` [PATCH v5 5/9] irqchip/al-fic: switch to shared parent interrupt Eliav Farber
2026-10-11  5:14   ` sashiko-bot [this message]
2026-10-11  5:04 ` [PATCH v5 6/9] dt-bindings: interrupt-controller: amazon,al-fic: add mask selection Eliav Farber
2026-10-11  5:04 ` [PATCH v5 7/9] irqchip/al-fic: support error and fatal outputs and FIC v2 Eliav Farber
2026-10-11  5:04 ` [PATCH v5 8/9] irqchip/al-fic: add support for FIC v3 Eliav Farber
2026-10-11  5:04 ` [PATCH v5 9/9] irqchip/al-fic: support per-child affinity via interrupt redirection Eliav Farber
2026-10-11  5:16   ` sashiko-bot
2026-10-12 19:10   ` Radu Rendec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-167032@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=farbere@amazon.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox