Skip to contentSkip to conversation

FAILED: patch "[PATCH] ACPI: PM: Do not turn off power resources in unknown state" failed to apply to 5.14-stable tree

PATCH [email protected] 1 participant 1 message Oct 24, 2021

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From bc28368596436e6e81ffc48c815b8225d96121c0 Mon Sep 17 00:00:00 2001
From: "Rafael J. Wysocki" <[email protected]>
Date: Fri, 15 Oct 2021 19:12:21 +0200
Subject: [PATCH] ACPI: PM: Do not turn off power resources in unknown state

Commit 6381195ad7d0 ("ACPI: power: Rework turning off unused power resources") caused power resources in unknown state with reference counters equal to zero to be turned off too, but that caused issues to appear in the field, so modify the code to only turn off power resources that are known to be "on".

Fixes 6381195ad7d0 ("ACPI: power: Rework turning off unused power resources")
Cc 5.14+ <[email protected]> # 5.14+
drivers/acpi/power.c +1 -6
index b9863e22b952..f0ed4414edb1 100644
@@ -1035,13 +1035,8 @@ void acpi_turn_off_unused_power_resources(void)
 	list_for_each_entry_reverse(resource, &acpi_power_resource_list, list_node) {
 		mutex_lock(&resource->resource_lock);
 
-		/*
-		 * Turn off power resources in an unknown state too, because the
-		 * platform firmware on some system expects the OS to turn off
-		 * power resources without any users unconditionally.
-		 */
 		if (!resource->ref_count &&
-		    resource->state != ACPI_POWER_RESOURCE_STATE_OFF) {
+		    resource->state == ACPI_POWER_RESOURCE_STATE_ON) {
 			acpi_handle_debug(resource->device.handle, "Turning OFF\n");
 			__acpi_power_off(resource);
 		}