This is a note to let you know that I've just added the patch titled thermal: core: Initialize thermal zones before registering them to the 6.11-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: thermal-core-initialize-thermal-zones-before-registe.patch and it can be found in the queue-6.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit a00521a3e2ca8bd1acf792415d27bf2aeac8e089 Author: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx> Date: Fri Oct 4 21:05:49 2024 +0200 thermal: core: Initialize thermal zones before registering them [ Upstream commit 662f920f7e390db5d1a6792a2b0ffa59b6c962fc ] Since user space can start interacting with a new thermal zone as soon as device_register() called by thermal_zone_device_register_with_trips() returns, it is better to initialize the thermal zone before calling device_register() on it. Fixes: d0df264fbd3c ("thermal/core: Remove pointless thermal_zone_device_reset() function") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx> Link: https://patch.msgid.link/3336146.44csPzL39Z@xxxxxxxxxxxxx Reviewed-by: Lukasz Luba <lukasz.luba@xxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 795be67ca878b..2f9128cf55e92 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1498,6 +1498,7 @@ thermal_zone_device_register_with_trips(const char *type, thermal_zone_destroy_device_groups(tz); goto remove_id; } + thermal_zone_device_init(tz); result = device_register(&tz->device); if (result) goto release_device; @@ -1543,7 +1544,6 @@ thermal_zone_device_register_with_trips(const char *type, mutex_unlock(&thermal_list_lock); - thermal_zone_device_init(tz); /* Update the new thermal zone and mark it as already updated. */ if (atomic_cmpxchg(&tz->need_update, 1, 0)) thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);