Re: [PATCH 2/3] thermal: qoriq_thermal: only enable supported sensors

From: Sebastian Krzyszkowiak
Date: Wed Jun 14 2023 - 22:53:34 EST


On czwartek, 15 czerwca 2023 04:29:01 CEST Peng Fan wrote:
> On 6/8/2023 3:10 AM, Daniel Lezcano wrote:
> >
> > [...]
> >
> > Ok, I misunderstood. I thought that was for failing registered thermal
> > zone.
> >
> > Would enabling the site in ops->change_mode do the trick ?
>
> No. ops->change_mode not able to do the trick.
>
> devm_thermal_of_zone_register->thermal_zone_device_enable
> ->thermal_zone_device_set_mode->__thermal_zone_device_update.part.0
> ->__thermal_zone_get_temp
>
> The thermal_zone_device_set_mode will call change_mode, if return
> fail here, the thermal zone will fail to be registered.
>
> Thanks,
> Peng.

I think the idea is not to return a failure in ops->change_mode, but to move
enabling the site in REGS_TMR/REGS_V2_TMSR register from
qoriq_tmu_register_tmu_zone to ops->change_mode. This way the site will be
enabled only for actually existing thermal zones, since those not described in
the device tree won't reach thermal_zone_device_enable.

S.