Commit Message

Due to hardware constraints, an ACPI hotplug slot may have dependencies
on other ACPI hotplug slots. For example, if a hotpluggable memory board
is connected to a hotpluggble physical processor, the physical processor
must be powered on before powering the memory board on.
According to physical and device tree topology constraints, we need to
consider following dependency relationships:
1) The parent slot must be powered on before powering a child slot on.
2) All child slots must be powered off before powering a parent slot off.
3) All devices in a slot's _EDL list must be powered off before powering
a slot off.
4) The parent ACPI device topology must be created before creating ACPI
devices for devices connecting to a child slot
5) All ACPI devices connecting to child slots must be destroyed before
destroying ACPI device topology for a parent slot.
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
drivers/acpi/hotplug/Makefile | 1 +
drivers/acpi/hotplug/acpihp_drv.h | 14 +++
drivers/acpi/hotplug/dependency.c | 249 +++++++++++++++++++++++++++++++++++++
3 files changed, 264 insertions(+)
create mode 100644 drivers/acpi/hotplug/dependency.c