Re: [PATCH] PCI: altera: Convert root port IRQ to a requested handler

From: Vaidya, Mahesh

Date: Fri Dec 04 2026 - 04:51:23 EST




On 30-10-2026 15:35, Manivannan Sadhasivam wrote:
On Wed, Oct 14, 2026 at 06:07:23PM +0800, Mahesh Vaidya wrote:
altera_pcie_irq_teardown() removes the chained handler before removing
the INTx domain. Removing the handler prevents new invocations, but does
not wait for one already running on another CPU. Such a handler can
therefore access pcie or pcie->irq_domain after they have been freed.

Chained handlers bypass handle_irq_event(), so synchronize_irq() cannot
rely on IRQD_IRQ_INPROGRESS and may return without waiting if the parent
irqchip does not report IRQCHIP_STATE_ACTIVE.

Convert the chained handler to a requested hard IRQ. Request it only
after creating the INTx domain and call free_irq() before removing the
domain. free_irq() then synchronizes against any in-flight handler.

Use IRQF_NO_THREAD because generic_handle_domain_irq() requires hardirq
context. Use IRQF_NO_SUSPEND to preserve the suspend behavior of the
previous chained cascade. Request and free the IRQ explicitly because
automatic devres cleanup happens after remove() returns.

Fixes: ec15c4d0d5d2 ("PCI: altera: Allow building as module")
Reported-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
Link: https://lore.kernel.org/linux-pci/20260430204330.3121003-3-mahesh.vaidya@xxxxxxxxxx/
Suggested-by: Dinh Nguyen <dinguyen@xxxxxxxxxx>
Assisted-by: ChatGPT:GPT-5
Signed-off-by: Mahesh Vaidya <mahesh.vaidya@xxxxxxxxxx>

Thomas, can you please share your review?

Thomas/Bjorn/Krzysztof

Gentle ping. Anything you need from me here, or is this still waiting on an IRQ review?
Still applies cleanly to v7.4-rc1 and pci/next.
The sashiko review of this posting came back with no issues found:
https://sashiko.dev/#/patchset/20261014100723.1643089-1-mahesh.vaidya@xxxxxxxxxx?part=1
I do not think this needs an IRQ maintainer ruling, IRQF_NO_SUSPEND
just preserves what the chained parent already did, since
suspend_device_irqs() skips chained descriptors. Happy to drop the flag
if anyone would rather, or to send a v2 without the Assisted-by: tag,
which the process docs have since removed.

- Mahesh


- Mani