Linux Power Management development
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@oss.nxp.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
	Peng Fan <peng.fan@nxp.com>,
	Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>
Cc: "amitk@kernel.org" <amitk@kernel.org>,
	"rui.zhang@intel.com" <rui.zhang@intel.com>,
	"andrew.smirnov@gmail.com" <andrew.smirnov@gmail.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	dl-linux-imx <linux-imx@nxp.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Alice Guo <alice.guo@nxp.com>
Subject: Re: [PATCH 2/3] thermal: qoriq_thermal: only enable supported sensors
Date: Fri, 16 Jun 2023 09:06:05 +0800	[thread overview]
Message-ID: <60c95298-68cd-0f6c-38cc-745da7b2a6ed@oss.nxp.com> (raw)
In-Reply-To: <7e843caa-8369-1fb0-36c4-a4482d37b211@linaro.org>



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
> 

  reply	other threads:[~2023-06-16  1:06 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16  8:37 [PATCH 0/3] thermal: qoriq_thermal: support TMU 2.1 Peng Fan (OSS)
2023-05-16  8:37 ` [PATCH 1/3] thermal: qoriq_thermal: No need to program site adjustment register Peng Fan (OSS)
2023-05-16  8:37 ` [PATCH 2/3] thermal: qoriq_thermal: only enable supported sensors Peng Fan (OSS)
2023-05-31 11:03   ` Daniel Lezcano
2023-05-31 12:05     ` Peng Fan
2023-05-31 12:35       ` Daniel Lezcano
2023-05-31 13:00         ` Peng Fan
2023-06-01  9:52           ` Peng Fan
2023-06-02 13:11             ` Daniel Lezcano
2023-06-07  6:01               ` Sebastian Krzyszkowiak
2023-06-07  8:28                 ` Daniel Lezcano
2023-06-07 17:42                   ` Sebastian Krzyszkowiak
2023-06-07 19:10                     ` Daniel Lezcano
2023-06-12  6:23                       ` Sebastian Krzyszkowiak
2023-06-15  2:29                       ` Peng Fan
2023-06-15  2:53                         ` Sebastian Krzyszkowiak
2023-06-15  4:04                           ` Peng Fan
2023-06-15 10:36                             ` Daniel Lezcano
2023-06-15 11:48                             ` Daniel Lezcano
2023-06-15 12:07                               ` Peng Fan
2023-06-15 13:49                                 ` Daniel Lezcano
2023-06-16  1:06                                   ` Peng Fan [this message]
2023-06-16  9:01                                     ` Daniel Lezcano
2023-05-16  8:37 ` [PATCH 3/3] thermal: qoriq: support version 2.1 Peng Fan (OSS)
2023-05-23  1:59 ` [PATCH 0/3] thermal: qoriq_thermal: support TMU 2.1 Alice Guo
2023-05-29  3:35 ` Peng Fan
2023-06-16  9:02 ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60c95298-68cd-0f6c-38cc-745da7b2a6ed@oss.nxp.com \
    --to=peng.fan@oss.nxp.com \
    --cc=alice.guo@nxp.com \
    --cc=amitk@kernel.org \
    --cc=andrew.smirnov@gmail.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=s.hauer@pengutronix.de \
    --cc=sebastian.krzyszkowiak@puri.sm \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox