PCI: Always enable ACS even if no ACS Capability
authorRajat Jain <rajatja@google.com>
Wed, 28 Oct 2020 23:15:45 +0000 (16:15 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 30 Oct 2020 21:26:51 +0000 (16:26 -0500)
commit462b58fb033996e999cc213ed0b430d4f22a28fe
tree9876a4987bf047d6ae97fdfd49212d5e533b8197
parent3650b228f83adda7e5ee532e2b90429c03f7b9ec
PCI: Always enable ACS even if no ACS Capability

Some devices support ACS functionality even though they don't have a
spec-compliant ACS Capability; pci_enable_acs() has a quirk mechanism to
handle them.

We want to enable ACS whenever possible, but 52fbf5bdeeef ("PCI: Cache ACS
capability offset in device") inadvertently broke this by calling
pci_enable_acs() only if we find an ACS Capability.

This resulted in ACS not being enabled for these non-compliant devices,
which means devices can't be separated into different IOMMU groups, which
in turn means we may not be able to pass those devices through to VMs, as
reported by Boris V:

  https://lore.kernel.org/r/74aeea93-8a46-5f5a-343c-790d4c655da3@bstnet.org

Fixes: 52fbf5bdeeef ("PCI: Cache ACS capability offset in device")
Link: https://lore.kernel.org/r/20201028231545.4116866-1-rajatja@google.com
Reported-by: Boris V <borisvk@bstnet.org>
Signed-off-by: Rajat Jain <rajatja@google.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
drivers/pci/pci.c