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
switch
access.c
ats.c iommufd: Extend IOMMU_GET_HW_INFO to report PASID capability 2025-03-28 10:07:23 -03:00
bus.c
devres.c
doe.c
ecam.c
host-bridge.c
iomap.c
iov.c
irq.c
Kconfig pci-v6.15-changes 2025-03-28 19:36:53 -07:00
Makefile
mmap.c
npem.c
of_property.c
of.c Merge branch 'pci/misc' 2025-03-27 13:15:05 -05:00
p2pdma.c
pci-acpi.c
pci-bridge-emul.c
pci-bridge-emul.h
pci-driver.c
pci-label.c
pci-mid.c
pci-pf-stub.c
pci-stub.c
pci-sysfs.c
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
quirks.c PCI: Run quirk_huawei_pcie_sva() before arm_smmu_probe_device() 2025-04-11 12:53:21 -05:00
remove.c
rom.c
search.c
setup-bus.c Merge branch 'pci/misc' 2025-03-27 13:15:05 -05:00
setup-res.c
slot.c
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
xen-pcifront.c