Revert "ACPI: scan: Release PM resources blocked by unused objects"
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 17 Nov 2021 16:05:41 +0000 (17:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Nov 2021 12:44:14 +0000 (13:44 +0100)
commit 3b2b49e6dfdcf423506a771bf44cee842596351a upstream.

Revert commit c10383e8ddf4 ("ACPI: scan: Release PM resources blocked
by unused objects"), because it causes boot issues to appear on some
platforms.

Reported-by: Kyle D. Pelton <kyle.d.pelton@intel.com>
Reported-by: Saranya Gopal <saranya.gopal@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/glue.c
drivers/acpi/internal.h
drivers/acpi/scan.c

index 1cfafa254e3d4904c65cfa60de8a62d9c9c1e881..7a33a6d985f8902e04129a6315cb9470c7eee407 100644 (file)
@@ -340,28 +340,3 @@ void acpi_device_notify_remove(struct device *dev)
 
        acpi_unbind_one(dev);
 }
-
-int acpi_dev_turn_off_if_unused(struct device *dev, void *not_used)
-{
-       struct acpi_device *adev = to_acpi_device(dev);
-
-       /*
-        * Skip device objects with device IDs, because they may be in use even
-        * if they are not companions of any physical device objects.
-        */
-       if (adev->pnp.type.hardware_id)
-               return 0;
-
-       mutex_lock(&adev->physical_node_lock);
-
-       /*
-        * Device objects without device IDs are not in use if they have no
-        * corresponding physical device objects.
-        */
-       if (list_empty(&adev->physical_node_list))
-               acpi_device_set_power(adev, ACPI_STATE_D3_COLD);
-
-       mutex_unlock(&adev->physical_node_lock);
-
-       return 0;
-}
index 8fbdc172864b0ae230bbb4a142156bb31f330d9a..d91b560e8867472d006c0bffbd9399b822a1636d 100644 (file)
@@ -117,7 +117,6 @@ bool acpi_device_is_battery(struct acpi_device *adev);
 bool acpi_device_is_first_physical_node(struct acpi_device *adev,
                                        const struct device *dev);
 int acpi_bus_register_early_device(int type);
-int acpi_dev_turn_off_if_unused(struct device *dev, void *not_used);
 
 /* --------------------------------------------------------------------------
                      Device Matching and Notification
index 770b82483d74de970a30c6d24486673f1cd09e6e..5b54c80b9d32a45bceeb6fc48a0ce0581f46f438 100644 (file)
@@ -2559,12 +2559,6 @@ int __init acpi_scan_init(void)
                }
        }
 
-       /*
-        * Make sure that power management resources are not blocked by ACPI
-        * device objects with no users.
-        */
-       bus_for_each_dev(&acpi_bus_type, NULL, NULL, acpi_dev_turn_off_if_unused);
-
        acpi_turn_off_unused_power_resources();
 
        acpi_scan_initialized = true;