linux/drivers/pci
Zhangfei Gao c8ba3f8aff PCI: Run quirk_huawei_pcie_sva() before arm_smmu_probe_device()
quirk_huawei_pcie_sva() sets properties needed by arm_smmu_probe_device(),
but bcb81ac6ae ("iommu: Get DT/ACPI parsing into the proper probe path")
changed the iommu_probe_device() flow so arm_smmu_probe_device() is now
invoked before the quirk, leading to failures like this:

  reg-dummy reg-dummy: late IOMMU probe at driver bind, something fishy here!
  WARNING: CPU: 0 PID: 1 at drivers/iommu/iommu.c:449 __iommu_probe_device+0x140/0x570
  RIP: 0010:__iommu_probe_device+0x140/0x570

The SR-IOV enumeration ordering changes like this:

  pci_iov_add_virtfn
    pci_device_add
      pci_fixup_device(pci_fixup_header)      <--
      device_add
        bus_notify
          iommu_bus_notifier
  +         iommu_probe_device
  +           arm_smmu_probe_device
    pci_bus_add_device
      pci_fixup_device(pci_fixup_final)       <--
      device_attach
        driver_probe_device
          really_probe
            pci_dma_configure
              acpi_dma_configure_id
  -             iommu_probe_device
  -               arm_smmu_probe_device

The non-SR-IOV case is similar in that pci_device_add() is called from
pci_scan_single_device() in the generic enumeration path and
pci_bus_add_device() is called later, after all host bridges have been
enumerated.

Declare quirk_huawei_pcie_sva() as a header fixup to ensure that it happens
before arm_smmu_probe_device().

Fixes: bcb81ac6ae ("iommu: Get DT/ACPI parsing into the proper probe path")
Reported-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Closes: https://lore.kernel.org/all/SJ1PR11MB61295DE21A1184AEE0786E25B9D22@SJ1PR11MB6129.namprd11.prod.outlook.com/
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
[bhelgaas: commit log, add failure info and reporter]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20250317011352.5806-1-zhangfei.gao@linaro.org
2025-04-11 12:53:21 -05:00
..
controller pci-v6.15-changes 2025-03-28 19:36:53 -07:00
endpoint Merge branch 'pci/misc' 2025-03-27 13:15:05 -05:00
hotplug treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
msi pci-v6.15-changes 2025-03-28 19:36:53 -07:00
pcie pci-v6.15-changes 2025-03-28 19:36:53 -07:00
pwrctrl PCI/pwrctrl: Add pwrctrl driver for PCI slots 2025-02-21 01:03:39 +00:00
switch PCI: switchtec: Add Microchip PCI100X device IDs 2025-01-21 10:47:28 -06:00
Kconfig pci-v6.15-changes 2025-03-28 19:36:53 -07:00
Makefile Merge branch 'pci/tph' 2024-11-25 13:40:55 -06:00
access.c
ats.c iommufd: Extend IOMMU_GET_HW_INFO to report PASID capability 2025-03-28 10:07:23 -03:00
bus.c PCI/pwrctrl: Move creation of pwrctrl devices to pci_scan_device() 2025-02-20 10:59:02 +00:00
devres.c PCI: Check BAR index for validity 2025-03-14 10:35:12 -05:00
doe.c PCI/DOE: Expose DOE features via sysfs 2025-03-21 16:36:01 -05:00
ecam.c PCI: Use resource_set_{range,size}() helpers 2024-10-10 17:44:57 -05:00
host-bridge.c
iomap.c PCI: Check BAR index for validity 2025-03-14 10:35:12 -05:00
iov.c PCI: Fix NULL dereference in SR-IOV VF creation error path 2025-03-21 14:54:16 -05:00
irq.c
mmap.c
npem.c PCI/NPEM: Add _DSM PCIe SSD status LED management 2024-09-06 11:37:24 -05:00
of.c Merge branch 'pci/misc' 2025-03-27 13:15:05 -05:00
of_property.c PCI: of: Create device tree PCI host bridge node 2025-02-28 15:13:51 -06:00
p2pdma.c mm: allow compound zone device pages 2025-03-17 22:06:39 -07:00
pci-acpi.c ACPI: RISC-V: Implement PCI related functionality 2024-08-27 15:48:35 +02:00
pci-bridge-emul.c PCI: Rename CRS Completion Status to RRS 2024-09-10 19:52:30 -05:00
pci-bridge-emul.h
pci-driver.c IOMMU Updates for Linux v6.15 2025-03-26 20:10:09 -07:00
pci-label.c
pci-mid.c PCI/PM: Switch to new Intel CPU model defines 2024-06-11 17:08:14 -05:00
pci-pf-stub.c PCI: Add missing MODULE_DESCRIPTION() macros 2024-07-08 08:35:35 +00:00
pci-stub.c PCI: Add missing MODULE_DESCRIPTION() macros 2024-07-08 08:35:35 +00:00
pci-sysfs.c Merge branch 'pci/resource' 2025-03-27 13:14:45 -05:00
pci.c Merge branch 'pci/misc' 2025-03-27 13:15:05 -05:00
pci.h Revert "Merge tag 'irq-msi-2025-03-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip" 2025-03-28 11:22:54 -07:00
probe.c pci-v6.15-changes 2025-03-28 19:36:53 -07:00
proc.c s390/pci: Introduce pdev->non_mappable_bars and replace VFIO_PCI_MMAP 2025-03-21 14:54:16 -05:00
quirks.c PCI: Run quirk_huawei_pcie_sva() before arm_smmu_probe_device() 2025-04-11 12:53:21 -05:00
remove.c Merge branch 'pci/devtree-create' 2025-03-27 13:14:45 -05:00
rom.c
search.c
setup-bus.c Merge branch 'pci/misc' 2025-03-27 13:15:05 -05:00
setup-res.c PCI: Do not claim to release resource falsely 2025-03-07 11:26:19 -06:00
slot.c PCI: hotplug: Inline pci_hp_{create,remove}_module_link() 2025-03-04 17:00:12 -06:00
syscall.c
tph.c Revert "Merge tag 'irq-msi-2025-03-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip" 2025-03-28 11:22:54 -07:00
vc.c
vgaarb.c
vpd.c PCI/VPD: Constify 'struct bin_attribute' 2024-12-03 15:25:41 -06:00
xen-pcifront.c