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

Daniel Lezcano daniel.lezcano at linaro.org
Fri Jun 16 02:01:59 PDT 2023


On 16/06/2023 03:06, Peng Fan wrote:
> 
> 
> On 6/15/2023 9:49 PM, 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 15/06/2023 14:07, Peng Fan wrote:
>>
>> [ ... ]
>>
>>> Per i.MX8MQ Reference manual:
>>> MSITE:
>>> Monitoring site select 0 - 2. By setting the select bit for a 
>>> temperature sensor site,
>>>   it is enabled and included in all monitoring functions. For proper 
>>> operation, this
>>> field should only change when monitoring is
>>> disabled. If no site is selected, site 0 is monitored by default.
>>>
>>> ME: Before enabling the TMU for monitoring, the TMU must be configured,
>>> see section Initialization Information. Failure to properly 
>>> initialize the
>>> configuration table may result in boundedly undefined
>>> behavior.
>>>
>>> So we must set the SITEs bits before enabling ME bit. So set TMR_ME when
>>> each time call invoke mode violates the spec.
>>>
>>> As I understand, change_mode is per zone, which means per msite for TMU,
>>> but TMU_ME is a global gating bit which should not be set before all 
>>> msites
>>> are set.
>>
>> Mmh, IIUC correctly the documentation, it says the monitoring must be
>> disabled when changing the sites. So in the proposed code, we shall
>> disable the TMU, update the site and then enable the TMU.
>>
>> Can you give a try to see if that works? If yes, then can you submit a
>> patch on top of this series. Meanwhile, I'll pick those changes.
> 
> 
> I did a basic test on i.MX8MQ, it seems work. But I still have concern
> because it volitates the spec, need disable TMU before updating MSITE.
> 
> And if we disable TMU when updating MSITE in your patch, there is 
> potential risk that zone0 is reading temperature, while we disable TMU
> and update MSITE for zone1. So zone0 may get invalid temperature because
> TMU is disabled at this window.
> 
> no good idea from my side, unless we keep check TMU_ME when
> getting temperature.

Yeah, that is a good point. We are ending up to do the TMU check in the 
get_temp() any. Thanks for taking the time to look it up.

   -- Daniel

-- 
<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




More information about the linux-arm-kernel mailing list