From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx> commit 494c7d055081da066424706b28faa9a4c719d852 upstream. It is reported that commit 5a5efdaffda5 ("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: 5a5efdaffda5 ("thermal: core: Resume thermal zones asynchronously") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218881 Reported-by: fhortner@xxxxxxxx Tested-by: fhortner@xxxxxxxx Cc: 6.8+ <stable@xxxxxxxxxxxxxxx> # 6.8+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/thermal/thermal_core.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1633,6 +1633,12 @@ static int thermal_pm_notify(struct noti static struct notifier_block thermal_pm_nb = { .notifier_call = thermal_pm_notify, + /* + * Run at the lowest priority to avoid interference between the thermal + * zone resume work items spawned by thermal_pm_notify() and the other + * PM notifiers. + */ + .priority = INT_MIN, }; static int __init thermal_init(void) Patches currently in stable-queue which might be from rafael.j.wysocki@xxxxxxxxx are queue-6.9/thermal-core-change-pm-notifier-priority-to-the-minimum.patch queue-6.9/acpi-resource-skip-irq-override-on-asus-vivobook-pro.patch queue-6.9/acpica-revert-acpica-avoid-info-mapping-multiple-bar.patch queue-6.9/acpi-resource-do-irq-override-on-gmxbgxx-xmg-apex-17.patch queue-6.9/acpi-scan-ignore-camera-graph-port-nodes-on-all-dell.patch queue-6.9/acpi-ec-evaluate-orphan-_reg-under-ec-device.patch queue-6.9/cpufreq-amd-pstate-fix-memory-leak-on-cpu-epp-exit.patch queue-6.9/acpi-video-add-backlight-native-quirk-for-lenovo-sli.patch queue-6.9/acpi-ec-install-address-space-handler-at-the-namespa.patch queue-6.9/acpi-x86-add-pnp_uart1_skip-quirk-for-lenovo-blade2-.patch queue-6.9/thermal-int340x-processor_thermal-support-shared-interrupts.patch