Re: [PATCH] PCI: apple: use fwnode_irq_get() for port IRQ lookup

Marc Zyngier <[email protected]> Thu, 23 Jul 2026 08:43:14 +0100
Newsgroups dev.linux.lists.llvm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci
Message-ID <[email protected]>
On Thu, 23 Jul 2026 00:12:14 +0100,
Rosen Penev <[email protected]> wrote:
> 
> Replace irq_of_parse_and_map() with fwnode_irq_get() on the PCIe
> controller device's fwnode, indexed by port->idx. This is equivalent
> for an OF-backed fwnode but uses the generic firmware-node API.
> 
> Unlike irq_of_parse_and_map(), fwnode_irq_get() returns a positive IRQ
> or a negative errno and never 0 (it rewrites 0 to -EINVAL). So store
> the result in an int and check for irq < 0, propagating the error
> (including -EPROBE_DEFER) instead of the previous unsigned int with an
> `if (!irq)` check that could never catch a negative failure.
> 
> Built for arm64 (defconfig + CONFIG_PCIE_APPLE) with LLVM=1;
> drivers/pci/controller/pcie-apple.o compiles cleanly.

But what is the point of this change? This driver is strongly OF-only,
and there is no parallel universe where it would support ACPI.

But more importantly: -EPROBE_DEFER would make things worse, because
there is nothing in the driver that actually deals with a state
rollback on probe failure.  Today, we rely on failing hard.

As it stands, I don't think this change is worse the hassle it has the
potential to generate.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.