From: sashiko-bot@kernel.org
To: "Krishna Chaitanya Chundru" <krishna.chundru@oss.qualcomm.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v9 3/4] PCI: dwc: Add dw_pcie_mask_msi() to mask chained MSI without freeing domain
Date: Sat, 14 Nov 2026 02:17:50 +0000 [thread overview]
Message-ID: <sashiko-outbox-214049@kernel.org> (raw)
In-Reply-To: <20261114-shutdown-v9-3-5430c9f242ed@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] PCI: dwc: dw_pcie_mask_msi() fails to mask chained IRQs under
lazy disable
--
commit d4b2b9fb18b8b61f597edf1b19b5aa67a2433fc6
Author: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
PCI: dwc: Add dw_pcie_mask_msi() to mask chained MSI without freeing domain
This commit adds a dw_pcie_mask_msi() helper to disable the controller's
chained MSI parent interrupts without removing the MSI IRQ domain.
> diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
> index 0837bb9e67e02..7f0126c5336bc 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-host.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
> @@ -240,6 +240,28 @@ void dw_pcie_free_msi(struct dw_pcie_rp *pp)
> }
> EXPORT_SYMBOL_GPL(dw_pcie_free_msi);
>
> +/**
> + * dw_pcie_mask_msi - Mask the chained MSI parent interrupt(s)
> + * @pp: DWC PCIe RP private data
> + *
> + * Disable the controller's chained MSI interrupt line(s) to stop further
> + * MSI delivery, while leaving the MSI IRQ domain and the MSI mappings held
> + * by downstream devices intact. Unlike dw_pcie_free_msi(), this does not
> + * remove the IRQ domain, so it is safe to call from the shutdown()/reboot
> + * path where PCI devices are not removed and their MSI descriptors must not
> + * be orphaned.
> + */
> +void dw_pcie_mask_msi(struct dw_pcie_rp *pp)
> +{
> + u32 ctrl;
> +
> + for (ctrl = 0; ctrl < MAX_MSI_CTRLS; ctrl++) {
> + if (pp->msi_irq[ctrl] > 0)
> + disable_irq(pp->msi_irq[ctrl]);
> + }
> +}
> +EXPORT_SYMBOL_GPL(dw_pcie_mask_msi);
[Severity: High]
Does disable_irq() actually mask pp->msi_irq[ctrl] when it is registered as
a chained handler via irq_set_chained_handler_and_data()?
On interrupt controllers that do not implement .irq_disable (such as ARM
GICv2 and GICv3), disable_irq() performs a lazy disable unless
_IRQ_DISABLE_UNLAZY is set: __irq_disable() only sets IRQD_IRQ_DISABLED and
leaves the hardware line unmasked, relying on standard flow handlers to
check irqd_irq_disabled() and mask the interrupt on the next delivery.
Because dw_pcie_msi_host_init() installs dw_chained_msi_isr() as a chained
flow handler, generic_handle_irq_desc() invokes dw_chained_msi_isr()
directly without checking irqd_irq_disabled() or setting
IRQD_IRQ_INPROGRESS. As a result, disable_irq() neither masks the hardware
interrupt nor synchronizes with an in-flight handler, and any MSI arriving
during or after controller clock/power teardown in the shutdown path will
still run dw_handle_msi_irq() and read unclocked DBI registers.
Calling irq_set_chained_handler_and_data(pp->msi_irq[ctrl], NULL, NULL), as
dw_pcie_free_msi() does before removing the domain, detaches the handler
and masks the interrupt line under desc->lock while leaving
pp->msi_irq_domain intact.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261114-shutdown-v9-0-5430c9f242ed@oss.qualcomm.com?part=3
next prev parent reply other threads:[~2026-11-14 2:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 2:00 [PATCH v9 0/4] PCI: qcom: Implement shutdown() to avoid SMMU/NoC errors on reboot Krishna Chaitanya Chundru
2026-11-14 2:00 ` [PATCH v9 1/4] PCI: host-common: Fix early bus-walk exit in d3cold_possible() Krishna Chaitanya Chundru
2026-11-14 2:07 ` sashiko-bot
2026-11-14 2:00 ` [PATCH v9 2/4] PCI: dwc: Force L2 link entry on shutdown/reboot without D3cold check Krishna Chaitanya Chundru
2026-11-14 2:13 ` sashiko-bot
2026-11-14 2:00 ` [PATCH v9 3/4] PCI: dwc: Add dw_pcie_mask_msi() to mask chained MSI without freeing domain Krishna Chaitanya Chundru
2026-11-14 2:17 ` sashiko-bot [this message]
2026-11-14 2:00 ` [PATCH v9 4/4] PCI: qcom: Implement shutdown() callback Krishna Chaitanya Chundru
2026-11-14 2:17 ` sashiko-bot
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-214049@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=krishna.chundru@oss.qualcomm.com \
--cc=linux-pci@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.