Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rosen Penev" <rosenp@gmail.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCHv2] PCI: xilinx: use fwnode_irq_get() for INTx IRQ lookup
Date: Thu, 16 Jul 2026 21:05:01 +0000	[thread overview]
Message-ID: <20260716210502.2D1921F00A3E@smtp.kernel.org> (raw)
In-Reply-To: <20260716205811.800920-1-rosenp@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The driver requests a shared IRQ before it masks hardware interrupts and before it allocates its IRQ domains, creating a race condition that can lead to an interrupt storm.
--

--- Patch [1]: [PATCHv2] PCI: xilinx: use fwnode_irq_get() for INTx IRQ lookup ---
commit 02b4ee51408c6b762dcc417c028ea4f662761599
Author: Rosen Penev <rosenp@gmail.com>

PCI: xilinx: use fwnode_irq_get() for INTx IRQ lookup

This commit replaces irq_of_parse_and_map() with fwnode_irq_get() for
looking up the INTx IRQ, checking the return value to properly propagate
errors such as -EPROBE_DEFER.

> diff --git a/drivers/pci/controller/pcie-xilinx.c b/drivers/pci/controller/pcie-xilinx.c
> --- a/drivers/pci/controller/pcie-xilinx.c
> +++ b/drivers/pci/controller/pcie-xilinx.c
> @@ -548,7 +548,10 @@ static int xilinx_pcie_parse_dt(struct xilinx_pcie *pcie)
>  	if (IS_ERR(pcie->reg_base))
>  		return PTR_ERR(pcie->reg_base);
>  
> -	irq = irq_of_parse_and_map(node, 0);
> +	irq = fwnode_irq_get(dev_fwnode(dev), 0);
> +	if (irq < 0)
> +		return irq;
> +
>  	err = devm_request_irq(dev, irq, xilinx_pcie_intr_handler,
>  			       IRQF_SHARED | IRQF_NO_THREAD,
>  			       "xilinx-pcie", pcie);

[Severity: High]
This is a pre-existing issue, but does requesting the shared IRQ here
create a race condition?

Looking at xilinx_pcie_probe(), xilinx_pcie_parse_dt() is called before
xilinx_pcie_init_port() masks the hardware interrupts, and before
xilinx_pcie_init_irq_domain() allocates the MSI and legacy IRQ domains.

If the shared IRQ fires before the domains are created,
xilinx_pcie_intr_handler() will execute with pcie->msi_domain and
pcie->leg_domain as NULL.

In that scenario, generic_handle_domain_irq() will return -EINVAL, leaving
the level-triggered interrupt unserviced. Because the handler returns
IRQ_HANDLED, could this immediately re-enter the handler and cause an
unhandled interrupt storm?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260716205811.800920-1-rosenp@gmail.com?part=1

      reply	other threads:[~2026-07-16 21:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 20:58 [PATCHv2] PCI: xilinx: use fwnode_irq_get() for INTx IRQ lookup Rosen Penev
2026-07-16 21:05 ` sashiko-bot [this message]

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=20260716210502.2D1921F00A3E@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rosenp@gmail.com \
    --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