Skip to content

Commit

Permalink
Revert "ACPI: scan: Release PM resources blocked by unused objects"
Browse files Browse the repository at this point in the history
commit 3b2b49e upstream.

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

Reported-by: Kyle D. Pelton <[email protected]>
Reported-by: Saranya Gopal <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
rafaeljw authored and gregkh committed Nov 21, 2021
1 parent ef2590a commit 1af7386
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
25 changes: 0 additions & 25 deletions drivers/acpi/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
1 change: 0 additions & 1 deletion drivers/acpi/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1af7386

Please sign in to comment.