PCI: VMD: ACPI: Make ACPI companion lookup work for VMD bus
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 24 Aug 2021 14:43:55 +0000 (16:43 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 2 Sep 2021 15:59:58 +0000 (17:59 +0200)
commit59dc33252ee777e02332774fbdf3381b1d5d5f5d
tree9d79c5bee28d83ab8bfc542d0e4da106077a86ab
parent6f1e8b12eec44ee047dc9e0a9544b2cfed739503
PCI: VMD: ACPI: Make ACPI companion lookup work for VMD bus

On some systems, in order to get to the deepest low-power state of
the platform (which may be necessary to save significant enough
amounts of energy while suspended to idle. for example), devices on
the PCI bus exposed by the VMD driver need to be power-managed via
ACPI.  However, the layout of the ACPI namespace below the VMD
controller device object does not reflect the layout of the PCI bus
under the VMD host bridge, so in order to identify the ACPI companion
objects for the devices on that bus, it is necessary to use a special
_ADR encoding on the ACPI side.  In other words, acpi_pci_find_companion()
does not work for these devices, so it needs to be amended with a
special lookup logic specific to the VMD bus.

Address this issue by allowing the VMD driver to temporarily install
an ACPI companion lookup hook containing the code matching the devices
on the VMD PCI bus with the corresponding objects in the ACPI
namespace.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Jon Derrick <jonathan.derrick@intel.com>
drivers/pci/controller/vmd.c
drivers/pci/host-bridge.c
drivers/pci/pci-acpi.c
include/linux/pci-acpi.h