mbox series

[v2,0/3] drivers/thermal/rcar_gen3_thermal: Fix device initialization

Message ID 20230208190333.3159879-1-niklas.soderlund+renesas@ragnatech.se (mailing list archive)
Headers show
Series drivers/thermal/rcar_gen3_thermal: Fix device initialization | expand

Message

Niklas Söderlund Feb. 8, 2023, 7:03 p.m. UTC
Hello,

This small series fixes a window where incorrect values can be read from
the driver before it is fully initialized. The root cause is that the
thermal zone is register too early.

Patch 1/3 is new in v2 and removes a unneeded call to set_trips() when 
resuming from suspend, This call was in v1 changed as part of addressing 
the initialization issue, it's nicer to get rid of it before that is 
needed.

Patch 2/3 prepares for the change while also fixing a theoretical issue
where one thermal node described in DT would describe interrupts and
another would not. Resulting in interrupt support being disabled for
both of them. I'm not aware of any case where this configuration would
be used, either the SoC supports interrupts, or it don't.

While patch 3/3 fixes the real issue by fully initializing the device
before registering the zone.

Niklas Söderlund (3):
  drivers/thermal/rcar_gen3_thermal: Do not call set_trips() when
    resuming
  drivers/thermal/rcar_gen3_thermal: Create device local ops struct
  drivers/thermal/rcar_gen3_thermal: Fix device initialization

 drivers/thermal/rcar_gen3_thermal.c | 36 ++++++++++++++---------------
 1 file changed, 18 insertions(+), 18 deletions(-)

Comments

Daniel Lezcano Feb. 10, 2023, 10:27 a.m. UTC | #1
On Wed, Feb 08, 2023 at 08:03:30PM +0100, Niklas Söderlund wrote:
> Hello,
> 
> This small series fixes a window where incorrect values can be read from
> the driver before it is fully initialized. The root cause is that the
> thermal zone is register too early.
> 
> Patch 1/3 is new in v2 and removes a unneeded call to set_trips() when 
> resuming from suspend, This call was in v1 changed as part of addressing 
> the initialization issue, it's nicer to get rid of it before that is 
> needed.
> 
> Patch 2/3 prepares for the change while also fixing a theoretical issue
> where one thermal node described in DT would describe interrupts and
> another would not. Resulting in interrupt support being disabled for
> both of them. I'm not aware of any case where this configuration would
> be used, either the SoC supports interrupts, or it don't.
> 
> While patch 3/3 fixes the real issue by fully initializing the device
> before registering the zone.
> 
> Niklas Söderlund (3):
>   drivers/thermal/rcar_gen3_thermal: Do not call set_trips() when
>     resuming
>   drivers/thermal/rcar_gen3_thermal: Create device local ops struct
>   drivers/thermal/rcar_gen3_thermal: Fix device initialization
> 
>  drivers/thermal/rcar_gen3_thermal.c | 36 ++++++++++++++---------------
>  1 file changed, 18 insertions(+), 18 deletions(-)

Applied, thhanks