]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: dwc: Remove MSI/MSIX capability for Root Port if iMSI-RX is used as MSI controller
authorQiang Yu <qiang.yu@oss.qualcomm.com>
Mon, 10 Nov 2025 06:59:42 +0000 (22:59 -0800)
committerManivannan Sadhasivam <mani@kernel.org>
Thu, 18 Dec 2025 07:24:07 +0000 (12:54 +0530)
Some platforms may not support ITS (Interrupt Translation Service) and MBI
(Message Based Interrupt), or there are not enough available empty SPI
lines for MBI, in which case the msi-map and msi-parent property will not
be provided in device tree node. For those cases, the DWC PCIe driver
defaults to using the iMSI-RX module as MSI controller. However, due to
DWC IP design, iMSI-RX cannot generate MSI interrupts for Root Ports even
when MSI is properly configured and supported as iMSI-RX will only monitor
and intercept incoming MSI TLPs from PCIe link, but the memory write
generated by Root Port are internal system bus transactions instead of
PCIe TLPs, so they are ignored.

This leads to interrupts such as PME, AER from the Root Port not received
on the host and the users have to resort to workarounds such as passing
"pcie_pme=nomsi" cmdline parameter.

To ensure reliable interrupt handling, remove MSI and MSI-X capabilities
from Root Ports when using iMSI-RX as MSI controller, which is indicated
by 'dw_pcie_rp::has_msi_ctrl == true'. This forces a fallback to INTx
interrupts by default, eliminating the need for manual kernel command line
workarounds.

With this behavior:
- Platforms with ITS/MBI support use ITS/MBI MSI for interrupts from all
  components.
- Platforms without ITS/MBI support fall back to INTx for Root Ports and
  use iMSI-RX for other PCI devices.

Signed-off-by: Qiang Yu <qiang.yu@oss.qualcomm.com>
[mani: reworded the comment]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Link: https://patch.msgid.link/20251109-remove_cap-v1-3-2208f46f4dc2@oss.qualcomm.com
drivers/pci/controller/dwc/pcie-designware-host.c

index 372207c33a857b4c98572bb1e9b61fa0080bc871..ffc95ddcf3bf38629cc43be8282541095e024f39 100644 (file)
@@ -1115,6 +1115,17 @@ int dw_pcie_setup_rc(struct dw_pcie_rp *pp)
 
        dw_pcie_dbi_ro_wr_dis(pci);
 
+       /*
+        * The iMSI-RX module does not support receiving MSI or MSI-X generated
+        * by the Root Port. If iMSI-RX is used as the MSI controller, remove
+        * the MSI and MSI-X capabilities of the Root Port to allow the drivers
+        * to fall back to INTx instead.
+        */
+       if (pp->has_msi_ctrl) {
+               dw_pcie_remove_capability(pci, PCI_CAP_ID_MSI);
+               dw_pcie_remove_capability(pci, PCI_CAP_ID_MSIX);
+       }
+
        return 0;
 }
 EXPORT_SYMBOL_GPL(dw_pcie_setup_rc);