[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53d33f48-1774-3a0e-a84e-a8027679ea5a@linaro.org>
Date: Tue, 9 Aug 2022 17:37:17 +0200
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: Guenter Roeck <linux@...ck-us.net>,
Michael Walle <michael@...le.cc>
Cc: daniel.lezcano@...exp.org, abailon@...libre.com,
anarsoul@...il.com, baolin.wang7@...il.com,
bjorn.andersson@...aro.org, broonie@...nel.org,
damien.lemoal@...nsource.wdc.com, digetx@...il.com,
f.fainelli@...il.com, glaroque@...libre.com,
hayashi.kunihiko@...ionext.com, heiko@...ech.de, j-keerthy@...com,
jonathanh@...dia.com, khilman@...libre.com,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
lukasz.luba@....com, matthias.bgg@...il.com,
mcoquelin.stm32@...il.com, mhiramat@...nel.org,
miquel.raynal@...tlin.com, niklas.soderlund@...natech.se,
rafael@...nel.org, rui.zhang@...el.com, shawnguo@...nel.org,
talel@...zon.com, thierry.reding@...il.com, tiny.windzz@...il.com
Subject: Re: [PATCH v5 00/33] New thermal OF code
On 09/08/2022 16:32, Guenter Roeck wrote:
> On 8/9/22 01:53, Daniel Lezcano wrote:
>> Hi Guenter,
>>
>> On 08/08/2022 12:26, Guenter Roeck wrote:
>>
>> [ ... ]
>>
>>>> But I guess even if that is fixed, the driver will not probe due to the
>>>> missing trip points? Are they now mandatory? Does it mean we'd need to
>>>> update our device trees? But that will then mean older devices trees
>>>> don't work anymore.
>>>
>>> It would also mean that all hwmon drivers registering a thermal zone
>>> sensor
>>> would fail to register unless such a thermal zone actually exists.
>>
>> Probably missing something but if the thermal zone is not described,
>> the hwmon driver won't initialize. And except if I'm wrong, that was
>> already the case before these changes, no?
>>
>
> In the hwmon source (you point to it below):
>
> if (IS_ERR(tzd)) {
> if (PTR_ERR(tzd) != -ENODEV)
> return PTR_ERR(tzd);
> dev_info(dev, "temp%d_input not attached to any thermal
> zone\n",
> index + 1);
> devm_kfree(dev, tdata);
> return 0;
> }
>
> That contradicts "if the thermal zone is not described, the hwmon driver
> won't initialize".
> Now I must be missing something, since you mention that yourself below,
> and your new patch
> series fixes the problem, at least AFAICS. Confused.
Sorry for not being clear. Let me try to explain it differently.
The function hwmon_thermal_add_sensor() is calling:
Without "[PATCH v5 00/33] New thermal OF code":
-----------------------------------------------
devm_thermal_zone_of_sensor_register(dev, index, ...);
If there is no thermal zone description or the 'dev' does not belong to
any thermal zone then -ENODEV is returned -> OK and the hwmon thermal
zone is _not_ created
With "[PATCH v5 00/33] New thermal OF code":
--------------------------------------------
devm_thermal_of_zone_register(dev, index, ...);
If there is no thermal zone description or the 'dev' does not belong to
any thermal zone then *-EINVAL* is returned -> NOK, error message, and
hwmon thermal zone is _not_ created
With "[PATCH v5 00/33] New thermal OF code" + fixes:
----------------------------------------------------
devm_thermal_of_zone_register(dev, index, ...);
If there is no thermal zone description or the 'dev' does not belong to
any thermal zone then *-ENODEV* is returned -> OK and the hwmon thermal
zone is _not_ created
Quoting your initial message:
"It would also mean that all hwmon drivers registering a thermal zone
sensor would fail to register unless such a thermal zone actually
exists. This would make the whole concept of having the hwmon core
register thermal zone sensors impossible [...]"
The thermal zone must be described if the OF registering function
variant is used. Except I'm wrong that was already the case before the
changes.
Otherwise, nothing prevents a hwmon to register itself with the core
code, that will create the thermal zone.
--
<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