[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <528cc9e4-f386-b941-f5c5-d3672042731c@linaro.org>
Date: Thu, 15 Jun 2023 12:36:22 +0200
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: Peng Fan <peng.fan@....nxp.com>,
Sebastian Krzyszkowiak <sebastian.krzyszkowiak@...i.sm>,
Peng Fan <peng.fan@....com>,
"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 15/06/2023 06:04, Peng Fan wrote:
>
>
> On 6/15/2023 10:53 AM, Sebastian Krzyszkowiak 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 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.
>
> But qoriq_tmu_register_tmu_zone will finally call ops->change_mode.
>
> And it is per zone, so we not able to enable TMR_ME here.
>
> 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.
>
> No. The TMR_ME is the gate for all sites.
Is it possible to call:
regmap_write(qdata->regmap, REGS_TMR, TMR_ME | TMR_ALPF | sites);
regmap_write(qdata->regmap, REGS_V2_TMSR, sites);
in change_mode:
And after the loop:
regmap_write(qdata->regmap, REGS_TMR, TMR_ME | TMR_ALPF_V2);
?
>
> Thanks,
> Peng.
>>
>> S.
>>
>>
--
<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