Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Shawn Lin" <shawn.lin@rock-chips.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v3 3/3] PCI: dw-rockchip: Mask the INTx IRQ while the controller clocks are gated
Date: Tue, 22 Sep 2026 02:51:55 +0000	[thread overview]
Message-ID: <20260922025156.1557D1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <1790044622-164744-4-git-send-email-shawn.lin@rock-chips.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] pci: dw-rockchip: leaked IRQ depth permanently masks INTx on reset failure
--

commit d458997529aaf8410a72de39760a744213ab9092
Author: Shawn Lin <shawn.lin@rock-chips.com>
Subject: PCI: dw-rockchip: Mask the INTx IRQ while the controller clocks are gated

This commit masks the INTx IRQ during root port resets to prevent synchronous
external aborts when downstream devices keep their INTx line asserted. The IRQ
is left masked on error paths since the clocks remain gated.

> diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> index 561c296c770eb..aee5ca8a6ca84 100644
> --- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> +++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> @@ -924,6 +924,16 @@ static int rockchip_pcie_rc_reset_root_port(struct pci_host_bridge *bridge,
>  	u32 val;
>  	int ret;
>  
> +	/*
> +	 * Devices may keep their INTx line asserted across the reset. Mask
> +	 * the INTx IRQ so that the chained handler does not touch the
> +	 * unclocked APB bus, which would raise a synchronous external abort.
> +	 * The IRQ is re-enabled once the clocks are restored, and is
> +	 * deliberately left masked on the error paths where the controller
> +	 * remains unclocked.
> +	 */
> +	disable_irq(rockchip->intx_irq);

[Severity: High]
Since disable_irq() increments the IRQ descriptor depth unconditionally,
does leaving the IRQ masked on error paths cause a permanent loss of INTx
interrupts if the reset is retried?

If rockchip_pcie_rc_reset_root_port() is called again after a failure,
disable_irq() will be called a second time, incrementing the depth counter
to 2. If that retry succeeds:

[ ... ]

> @@ -974,6 +984,7 @@ static int rockchip_pcie_rc_reset_root_port(struct pci_host_bridge *bridge,
>  
>  	/* Ignore errors, the link may come up later */
>  	dw_pcie_wait_for_link(pci);
> +	enable_irq(rockchip->intx_irq);

the depth counter will only be decremented to 1, and the INTx interrupts for
all downstream devices will remain permanently masked. Is there a way to
ensure the enable/disable depth remains balanced when recovering from reset
failures?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/1790044622-164744-1-git-send-email-shawn.lin@rock-chips.com?part=3

  reply	other threads:[~2026-09-22  2:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  2:36 [PATCH v3 0/3] Small INTx fixes for Rockchip's dwc based PCIe controller driver Shawn Lin
2026-09-22  2:37 ` [PATCH v3 1/3] PCI: dw-rockchip: Move the INTx irq setup to probe Shawn Lin
2026-09-22  2:51   ` sashiko-bot
2026-09-22 12:03     ` Niklas Cassel
2026-09-22  9:56   ` Niklas Cassel
2026-09-22  2:37 ` [PATCH v3 2/3] PCI: dw-rockchip: Make the INTx irq setup devm-managed Shawn Lin
2026-09-22  2:54   ` sashiko-bot
2026-09-22  9:58   ` Niklas Cassel
2026-09-22  2:37 ` [PATCH v3 3/3] PCI: dw-rockchip: Mask the INTx IRQ while the controller clocks are gated Shawn Lin
2026-09-22  2:51   ` sashiko-bot [this message]
2026-09-23  9:13 ` [PATCH v3 0/3] Small INTx fixes for Rockchip's dwc based PCIe controller driver Diederik de Haas
2026-09-23  9:21   ` Shawn Lin
2026-09-23 15:25     ` Niklas Cassel
2026-09-24  3:27       ` Shawn Lin

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=20260922025156.1557D1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shawn.lin@rock-chips.com \
    /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