mbox series

[v2,0/2] thermal: core: Fix thermal zone initialization and move passive polling management to the core

Message ID 5790995.DvuYhMxLoT@kreacher
Headers show
Series thermal: core: Fix thermal zone initialization and move passive polling management to the core | expand

Message

Rafael J. Wysocki April 30, 2024, 3:44 p.m. UTC
Hi Everyone,

This a v2 of the patch at

https://lore.kernel.org/linux-pm/5938055.MhkbZ0Pkbq@kreacher/

with one fix patch added and a couple of changes more in the main patch.

Patch [1/2] fixes the thermal zone initialization in the cases when getting the
first zone temperature from the sensor is delayed and patch [2/2] is an update
of the patch above.

Thanks!

Comments

Lukasz Luba April 30, 2024, 4:43 p.m. UTC | #1
On 4/30/24 16:45, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Make __thermal_zone_device_update() bail out if update_temperature()
> fails to update the zone temperature because __thermal_zone_get_temp()
> has returned an error and the current zone temperature is
> THERMAL_TEMP_INVALID (user space receiving netlink thermal messages,
> thermal debug code and thermal governors may get confused otherwise).
> 
> Fixes: 9ad18043fb35 ("thermal: core: Send trip crossing notifications at init time if needed")
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> 
> New patch in v2.
> 
> ---
>   drivers/thermal/thermal_core.c |    3 +++
>   1 file changed, 3 insertions(+)
> 
> Index: linux-pm/drivers/thermal/thermal_core.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/thermal_core.c
> +++ linux-pm/drivers/thermal/thermal_core.c
> @@ -487,6 +487,9 @@ void __thermal_zone_device_update(struct
>   
>   	update_temperature(tz);
>   
> +	if (tz->temperature == THERMAL_TEMP_INVALID)
> +		return;
> +
>   	__thermal_zone_set_trips(tz);
>   
>   	tz->notify_event = event;
> 
> 
> 

Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>