@@ -103,8 +103,8 @@ int acpi_bus_get_status(struct acpi_device *device)
return 0;
}
- /* Battery devices must have their deps met before calling _STA */
- if (acpi_device_is_battery(device) && device->dep_unmet) {
+ /* If honor_deps is set, the deps must be met before calling _STA */
+ if (device->honor_deps && device->dep_unmet) {
acpi_set_device_status(device, 0);
return 0;
}
@@ -1756,6 +1756,10 @@ static void acpi_scan_dep_init(struct acpi_device *adev)
{
struct acpi_dep_data *dep;
+ /* Always honor the deps for battery devices */
+ if (acpi_device_is_battery(adev))
+ adev->honor_deps = true;
+
list_for_each_entry(dep, &acpi_dep_list, node) {
if (dep->consumer == adev->handle)
adev->dep_unmet++;
@@ -381,6 +381,7 @@ struct acpi_device {
struct device dev;
unsigned int physical_node_count;
unsigned int dep_unmet;
+ bool honor_deps;
struct list_head physical_node_list;
struct mutex physical_node_lock;
void (*remove)(struct acpi_device *);
At the moment dependencies by _DEP are mostly ignored by the ACPI code, other then acpi_bus_scan() instantiating all devices without _DEP-s before instantiating devices with _DEP-s. The on exception to this is ACPI battery devices for which _DEP-s are fully honored. Now another case has come-up where we want to honor the _DEP-s. In preparation for this add a new honor_deps flag to struct acpi_device and move the existing battery special-case over to this flag. Signed-off-by: Hans de Goede <hdegoede@redhat.com> --- drivers/acpi/bus.c | 4 ++-- drivers/acpi/scan.c | 4 ++++ include/acpi/acpi_bus.h | 1 + 3 files changed, 7 insertions(+), 2 deletions(-)