Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 494c7d0

Browse files
committed
thermal: core: Change PM notifier priority to the minimum
It is reported that commit 5a5efda ("thermal: core: Resume thermal zones asynchronously") causes battery data in sysfs on Thinkpad P1 Gen2 to become invalid after a resume from S3 (and it is necessary to reboot the machine to restore correct battery data). Some investigation into the problem indicated that it happened because, after the commit in question, the ACPI battery PM notifier ran in parallel with thermal_zone_device_resume() for one of the thermal zones which apparently confused the platform firmware on the affected system. While the exact reason for the firmware confusion remains unclear, it is arguably not particularly relevant, and the expected behavior of the affected system can be restored by making the thermal PM notifier run at the lowest priority which avoids interference between work items spawned by it and the other PM notifiers (that will run before those work items now). Fixes: 5a5efda ("thermal: core: Resume thermal zones asynchronously") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218881 Reported-by: fhortner@yahoo.de Tested-by: fhortner@yahoo.de Cc: 6.8+ <stable@vger.kernel.org> # 6.8+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent d2278f3 commit 494c7d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/thermal/thermal_core.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,6 +1721,12 @@ static int thermal_pm_notify(struct notifier_block *nb,
17211721

17221722
static struct notifier_block thermal_pm_nb = {
17231723
.notifier_call = thermal_pm_notify,
1724+
/*
1725+
* Run at the lowest priority to avoid interference between the thermal
1726+
* zone resume work items spawned by thermal_pm_notify() and the other
1727+
* PM notifiers.
1728+
*/
1729+
.priority = INT_MIN,
17241730
};
17251731

17261732
static int __init thermal_init(void)

0 commit comments

Comments
 (0)