Re: [PATCH 2/2] drivers/thermal/rcar_gen3_thermal: Fix device initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 07, 2023 at 06:10:11PM +0100, Niklas Söderlund wrote:
> The thermal zone is registered before the device is register and the
> thermal coefficients are calculated, providing a window for very
> incorrect readings.

While I could never actually be in this race window, the patch makes a
lot of sense to me.

> The reason why the zone was register before the device was fully
> initialized was that the presence of the set_trips() callback is used to
> determine if the driver supports interrupt or not, as it is not defined
> if the device is incapable of interrupts.
> 
> Fix this by using the operations structure in the private data instead
> of the zone to determine if interrupts are available or not, and
> initialize the device before registering the zone.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>

Reviewed-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>

One minor question:

> -		if (status)
> +		if (status && priv->tscs[i]->zone)
>  			thermal_zone_device_update(priv->tscs[i]->zone,
>  						   THERMAL_EVENT_UNSPECIFIED);

Isn't this a seperate change?

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux