[PATCH v2] PCI: j721e: Disable INTx mapping and swizzling

From: Siddharth Vadapalli
Date: Fri Jul 26 2024 - 09:59:33 EST


Since the configuration of INTx (Legacy Interrupt) is not supported, set
the .map_irq and .swizzle_irq callbacks to NULL. This fixes the error:
of_irq_parse_pci: failed with rc=-22
when the pcieport driver attempts to setup INTx for the Host Bridge via
"pci_assign_irq()". The device-tree node of the Host Bridge doesn't
contain Legacy Interrupts. As a result, Legacy Interrupts are searched for
in the MSI Interrupt Parent of the Host Bridge with the help of
"of_irq_parse_raw()". Since the MSI Interrupt Parent of the Host Bridge
uses 3 interrupt cells while Legacy Interrupts only use 1, the search
for Legacy Interrupts is terminated prematurely by the "of_irq_parse_raw()"
function with the -EINVAL error code (rc=-22).

Fixes: f3e25911a430 ("PCI: j721e: Add TI J721E PCIe driver")
Cc: stable@xxxxxxxxxxxxxxx
Reported-by: Andrew Halaney <ahalaney@xxxxxxxxxx>
Tested-by: Andrew Halaney <ahalaney@xxxxxxxxxx>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@xxxxxx>
---

Hello,

This patch is based on commit
1722389b0d86 Merge tag 'net-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
of Mainline Linux.

v1:
https://lore.kernel.org/r/20240724065048.285838-1-s-vadapalli@xxxxxx
Changes since v1:
- Added "Cc: stable@xxxxxxxxxxxxxxx" in the commit message.
- Based on Bjorn's feedback at:
https://lore.kernel.org/r/20240724162304.GA802428@bhelgaas/
the $subject and commit message have been updated. Additionally, the
comment in the driver has also been updated to specify "INTx" instead of
"Legacy Interrupts".
- Collected Tested-by tag from Andrew Halaney <ahalaney@xxxxxxxxxx>:
https://lore.kernel.org/r/vj6vtjphpmqv6hcblaalr2m4bwjujjwvom6ca4bjdzcmgazyaa@436unrb2lav7/

Patch has been tested on J721e-EVM and J784S4-EVM.

Regards,
Siddharth.

drivers/pci/controller/cadence/pci-j721e.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c
index 85718246016b..eaa6cfeb03c7 100644
--- a/drivers/pci/controller/cadence/pci-j721e.c
+++ b/drivers/pci/controller/cadence/pci-j721e.c
@@ -417,6 +417,10 @@ static int j721e_pcie_probe(struct platform_device *pdev)
if (!bridge)
return -ENOMEM;

+ /* INTx is not supported */
+ bridge->map_irq = NULL;
+ bridge->swizzle_irq = NULL;
+
if (!data->byte_access_allowed)
bridge->ops = &cdns_ti_pcie_host_ops;
rc = pci_host_bridge_priv(bridge);
--
2.40.1