summaryrefslogtreecommitdiff
path: root/include/linux/acpi_viot.h
diff options
context:
space:
mode:
authorEric Auger <eric.auger@redhat.com>2022-06-30 12:40:59 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-07-05 21:25:39 +0300
commit3dcb861dbc6ab101838a1548b1efddd00ca3c3ec (patch)
tree206893bed229a01f88b40ae49984ec31688c1b2d /include/linux/acpi_viot.h
parent88084a3df1672e131ddc1b4e39eeacfd39864acf (diff)
downloadlinux-3dcb861dbc6ab101838a1548b1efddd00ca3c3ec.tar.xz
ACPI: VIOT: Fix ACS setup
Currently acpi_viot_init() gets called after the pci device has been scanned and pci_enable_acs() has been called. So pci_request_acs() fails to be taken into account leading to wrong single iommu group topologies when dealing with multi-function root ports for instance. We cannot simply move the acpi_viot_init() earlier, similarly as the IORT init because the VIOT parsing relies on the pci scan. However we can detect VIOT is present earlier and in such a case, request ACS. Introduce a new acpi_viot_early_init() routine that allows to call pci_request_acs() before the scan. While at it, guard the call to pci_request_acs() with #ifdef CONFIG_PCI. Fixes: 3cf485540e7b ("ACPI: Add driver for the VIOT table") Signed-off-by: Eric Auger <eric.auger@redhat.com> Reported-by: Jin Liu <jinl@redhat.com> Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/acpi_viot.h')
-rw-r--r--include/linux/acpi_viot.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/acpi_viot.h b/include/linux/acpi_viot.h
index 1eb8ee5b0e5f..a5a122431563 100644
--- a/include/linux/acpi_viot.h
+++ b/include/linux/acpi_viot.h
@@ -6,9 +6,11 @@
#include <linux/acpi.h>
#ifdef CONFIG_ACPI_VIOT
+void __init acpi_viot_early_init(void);
void __init acpi_viot_init(void);
int viot_iommu_configure(struct device *dev);
#else
+static inline void acpi_viot_early_init(void) {}
static inline void acpi_viot_init(void) {}
static inline int viot_iommu_configure(struct device *dev)
{