[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <60c95298-68cd-0f6c-38cc-745da7b2a6ed@oss.nxp.com>
Date: Fri, 16 Jun 2023 09:06:05 +0800
From: Peng Fan <peng.fan@....nxp.com>
To: Daniel Lezcano <daniel.lezcano@...aro.org>,
Peng Fan <peng.fan@....com>,
Sebastian Krzyszkowiak <sebastian.krzyszkowiak@...i.sm>,
"rafael@...nel.org" <rafael@...nel.org>,
"shawnguo@...nel.org" <shawnguo@...nel.org>,
"s.hauer@...gutronix.de" <s.hauer@...gutronix.de>
Cc: "amitk@...nel.org" <amitk@...nel.org>,
"rui.zhang@...el.com" <rui.zhang@...el.com>,
"andrew.smirnov@...il.com" <andrew.smirnov@...il.com>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kernel@...gutronix.de" <kernel@...gutronix.de>,
"festevam@...il.com" <festevam@...il.com>,
dl-linux-imx <linux-imx@....com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Alice Guo <alice.guo@....com>
Subject: Re: [PATCH 2/3] thermal: qoriq_thermal: only enable supported sensors
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.
Thanks,
Peng.
>
> Thanks
> -- 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
>
Powered by blists - more mailing lists