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

From: Peng Fan
Date: Wed Jun 14 2023 - 22:29:24 EST




On 6/8/2023 3:10 AM, Daniel Lezcano wrote:
Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button


On 07/06/2023 19:42, Sebastian Krzyszkowiak wrote:

[ ... ]

Hence, the thermal_zone_device_register_with_trips() is not called, the
thermal zone is not created neither updated.

Again - that's not the case the check is there for. It's there for zones that
do exist and that do get registered, because REGS_TMR only gets set *after*
all the zones are already registered (the driver as it is right now does not
know which sites it should enable before registering the zones). Because of
that, the first value a zone gets after being registered is always bogus,
because no monitoring site has been enabled yet at all.

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.








--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog