Skip to content

Prevent binding PCI drivers to PCI devices used by non-pci drivers

Jiang Liu linux-acpi linux-pci lkml 1 version Applied

Status from this message: Applied to iommu/fixes, thanks Jiang.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest2 patches 2 repliesApplied

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/2iommu/amd: Prevent binding other PCI drivers to IOMMU PCI devicesdrivers/iommu/amd_iommu_init.c+3 -01 reply
2/2ACPI, PCI: Prevent binding other PCI drivers to IOAPIC PCI devicesdrivers/acpi/ioapic.c+5 -21 reply

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchJoerg Roedel
1/2
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [Bugfix v4 0/2] Prevent binding PCI drivers to PCI devices used by non-pci drivers

Hi Joerg,
I prepared this patchset yesterday but forgot to send them out.
I think it still worth sending out for review, so here we go:)

---
Commit 991de2e59090 ("PCI, x86: Implement pcibios_alloc_irq() and pcibios_free_irq()") breaks suspend/resume on some AMD platforms. The root cause is:
1) AMD IOMMU drivers enables MSI on IOMMU PCI devices at early boot stage
2) PCI driver binding code tries to allocate/free PCI legacy IRQ when binding other PCI drivers to IOMMU PCI devices at later boot stage, and breaks PCI MSI allocation information.
3) System resume breaks when restoring PCI MSI state using the damaged data.

We have tried on solution to detect that a PCI is in use by IOMMU driver by checking pci_msi_enabled(). But that's too specific, actually we should prevent binding PCI drivers to PCI devices used by non-PCI drivers.

Fortunately, we could prevent binding PCI drivers to PCI devices by setting pci_dev->match_driver to false. If needed, we could implement a helper function to manipulate pci_dev->match_driver.

Jiang Liu (2):
iommu/amd: Prevent binding other PCI drivers to IOMMU PCI devices ACPI, PCI: Prevent binding other PCI drivers to IOAPIC PCI devices

 drivers/acpi/ioapic.c          |    7 +++++--
 drivers/iommu/amd_iommu_init.c |    3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.10.4