[PATCH v2 0/2] PCI: altera: Fix IRQ cleanup on probe failure

Mahesh Vaidya posted 2 patches 1 month, 2 weeks ago
drivers/pci/controller/pcie-altera.c | 36 +++++++++++++++++++++++++---
1 file changed, 33 insertions(+), 3 deletions(-)
[PATCH v2 0/2] PCI: altera: Fix IRQ cleanup on probe failure
Posted by Mahesh Vaidya 1 month, 2 weeks ago
This series addresses review feedback from v1 of the Altera PCIe probe
failure cleanup fix.

Patch 1 removes irq_dispose_mapping(pcie->irq) from the IRQ teardown
path. pcie->irq is the parent IRQ returned by platform_get_irq(), not an
IRQ created by the Altera INTx irq_domain, so the driver should detach
the chained handler but not dispose the parent IRQ mapping.

Patch 2 fixes the original probe failure issue. The chained handler is
now installed only after the INTx domain is created, controller interrupts
are disabled during teardown, and the IRQ setup is torn down if
pci_host_probe() fails.

Tested on Agilex 7 and Stratix 10:
- Boot and fio read/write through a PCIe endpoint.
- Probe-failure cleanup path by injecting a failure before
  pci_host_probe().

Changes since v1:
- Removed irq_dispose_mapping(pcie->irq), since pcie->irq is the parent
  IRQ returned by platform_get_irq().
- Added controller interrupt disable helper.
- Disabled controller interrupts before tearing down the chained handler
  and INTx domain.
- Reused the teardown path when pci_host_probe() fails.

v1:
https://lore.kernel.org/linux-pci/20260427175302.570671-1-mahesh.vaidya@altera.com/

Mahesh Vaidya (2):
  PCI: altera: Do not dispose parent IRQ mapping
  PCI: altera: Fix resource leaks on probe failure

 drivers/pci/controller/pcie-altera.c | 36 +++++++++++++++++++++++++---
 1 file changed, 33 insertions(+), 3 deletions(-)


base-commit: 4224e91fea5695a89843b4c38283016616946307
-- 
2.34.1
Re: [PATCH v2 0/2] PCI: altera: Fix IRQ cleanup on probe failure
Posted by Manivannan Sadhasivam 1 month ago
On Thu, 30 Apr 2026 13:43:28 -0700, Mahesh Vaidya wrote:
> This series addresses review feedback from v1 of the Altera PCIe probe
> failure cleanup fix.
> 
> Patch 1 removes irq_dispose_mapping(pcie->irq) from the IRQ teardown
> path. pcie->irq is the parent IRQ returned by platform_get_irq(), not an
> IRQ created by the Altera INTx irq_domain, so the driver should detach
> the chained handler but not dispose the parent IRQ mapping.
> 
> [...]

Applied, thanks!

[1/2] PCI: altera: Do not dispose parent IRQ mapping
      commit: 5ef4bac02189bee0b7c170e352d7a38e13fe9678
[2/2] PCI: altera: Fix resource leaks on probe failure
      commit: 7a94138caeb27f3c49c1dbd93bf422098925bb28

Best regards,
-- 
Manivannan Sadhasivam <mani@kernel.org>