diff mbox series

[v3,2/2] dt-bindings: mfd: Add properties for thermal sensor cells

Message ID 20241113024000.3327161-2-lschyi@chromium.org (mailing list archive)
State New
Headers show
Series [v3,1/2] hwmon: (cros_ec) register thermal sensors to thermal framework | expand

Commit Message

Sung-Chi, Li Nov. 13, 2024, 2:39 a.m. UTC
The cros_ec supports reading thermal values from thermal sensors
connect to it. Add the property '#thermal-sensor-cells' bindings, such
that thermal framework can recognize cros_ec as a valid thermal device.

Signed-off-by: Sung-Chi, Li <lschyi@chromium.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
 Changes in v2:
   - Add changes for DTS binding.
 Changes in v3:
   - Remove unneeded Change-Id tag in commit message.
---
 Documentation/devicetree/bindings/mfd/google,cros-ec.yaml | 3 +++
 1 file changed, 3 insertions(+)

Comments

Guenter Roeck Nov. 13, 2024, 3:05 a.m. UTC | #1
On 11/12/24 18:39, Sung-Chi, Li wrote:
> The cros_ec supports reading thermal values from thermal sensors
> connect to it. Add the property '#thermal-sensor-cells' bindings, such
> that thermal framework can recognize cros_ec as a valid thermal device.
> 
> Signed-off-by: Sung-Chi, Li <lschyi@chromium.org>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> ---
>   Changes in v2:
>     - Add changes for DTS binding.
>   Changes in v3:
>     - Remove unneeded Change-Id tag in commit message.
> ---

I can't apply this one (not in hwmon space), so

Acked-by: Guenter Roeck <linux@roeck-us.net>

with the assumption that Lee will pick it up.

Thanks,
Guenter

>   Documentation/devicetree/bindings/mfd/google,cros-ec.yaml | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml b/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
> index aac8819bd00b..c7d63e3aacd2 100644
> --- a/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
> +++ b/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
> @@ -96,6 +96,9 @@ properties:
>     '#gpio-cells':
>       const: 2
>   
> +  '#thermal-sensor-cells':
> +    const: 1
> +
>     gpio-controller: true
>   
>     typec:
Krzysztof Kozlowski Nov. 25, 2024, 8:52 a.m. UTC | #2
On 13/11/2024 04:05, Guenter Roeck wrote:
> On 11/12/24 18:39, Sung-Chi, Li wrote:
>> The cros_ec supports reading thermal values from thermal sensors
>> connect to it. Add the property '#thermal-sensor-cells' bindings, such
>> that thermal framework can recognize cros_ec as a valid thermal device.
>>
>> Signed-off-by: Sung-Chi, Li <lschyi@chromium.org>
>> Acked-by: Conor Dooley <conor.dooley@microchip.com>
>> ---
>>   Changes in v2:
>>     - Add changes for DTS binding.
>>   Changes in v3:
>>     - Remove unneeded Change-Id tag in commit message.
>> ---
> 
> I can't apply this one (not in hwmon space), so
> 
> Acked-by: Guenter Roeck <linux@roeck-us.net>
> 
> with the assumption that Lee will pick it up.

This was merged, while I was AFK, so the ship has sailed, but let me
state here objection for any future discussions:

NAK, this is not a thermal sensor. The commit msg explains what they
want to achieve, but that's not a valid reason to add property from
different class of devices.

This is some hardware/temperature monitoring device or power supply, not
part of SoC, not integrated into any SoC thermal zone. Calling it
thermal sensor is huge stretch and inappropriate hardware description
leading to next patches like calling it a SoC cooling device, instead of
simple power supply (for which we have bindings!).

Best regards,
Krzysztof
Krzysztof Kozlowski Nov. 25, 2024, 8:54 a.m. UTC | #3
On 25/11/2024 09:52, Krzysztof Kozlowski wrote:
> On 13/11/2024 04:05, Guenter Roeck wrote:
>> On 11/12/24 18:39, Sung-Chi, Li wrote:
>>> The cros_ec supports reading thermal values from thermal sensors
>>> connect to it. Add the property '#thermal-sensor-cells' bindings, such
>>> that thermal framework can recognize cros_ec as a valid thermal device.
>>>
>>> Signed-off-by: Sung-Chi, Li <lschyi@chromium.org>
>>> Acked-by: Conor Dooley <conor.dooley@microchip.com>
>>> ---
>>>   Changes in v2:
>>>     - Add changes for DTS binding.
>>>   Changes in v3:
>>>     - Remove unneeded Change-Id tag in commit message.
>>> ---
>>
>> I can't apply this one (not in hwmon space), so
>>
>> Acked-by: Guenter Roeck <linux@roeck-us.net>
>>
>> with the assumption that Lee will pick it up.
> 
> This was merged, while I was AFK, so the ship has sailed, but let me
> state here objection for any future discussions:
> 
> NAK, this is not a thermal sensor. The commit msg explains what they
> want to achieve, but that's not a valid reason to add property from
> different class of devices.
> 
> This is some hardware/temperature monitoring device or power supply, not
> part of SoC, not integrated into any SoC thermal zone. Calling it
> thermal sensor is huge stretch and inappropriate hardware description
> leading to next patches like calling it a SoC cooling device, instead of
> simple power supply (for which we have bindings!).
Ah, wait, this was not merged, so I can actually NAK it.

BTW, all your patches are incorrectly ordered - bindings are always
before the users. You cannot merge user of a binding without or before
the binding.

Best regards,
Krzysztof
Guenter Roeck Nov. 25, 2024, 3:13 p.m. UTC | #4
On 11/25/24 00:52, Krzysztof Kozlowski wrote:
> On 13/11/2024 04:05, Guenter Roeck wrote:
>> On 11/12/24 18:39, Sung-Chi, Li wrote:
>>> The cros_ec supports reading thermal values from thermal sensors
>>> connect to it. Add the property '#thermal-sensor-cells' bindings, such
>>> that thermal framework can recognize cros_ec as a valid thermal device.
>>>
>>> Signed-off-by: Sung-Chi, Li <lschyi@chromium.org>
>>> Acked-by: Conor Dooley <conor.dooley@microchip.com>
>>> ---
>>>    Changes in v2:
>>>      - Add changes for DTS binding.
>>>    Changes in v3:
>>>      - Remove unneeded Change-Id tag in commit message.
>>> ---
>>
>> I can't apply this one (not in hwmon space), so
>>
>> Acked-by: Guenter Roeck <linux@roeck-us.net>
>>
>> with the assumption that Lee will pick it up.
> 
> This was merged, while I was AFK, so the ship has sailed, but let me
> state here objection for any future discussions:
> 
> NAK, this is not a thermal sensor. The commit msg explains what they
> want to achieve, but that's not a valid reason to add property from
> different class of devices.
> 
> This is some hardware/temperature monitoring device or power supply, not
> part of SoC, not integrated into any SoC thermal zone. Calling it

I am confused. We have several thermal sensors registering as thermal
zone, and fan controllers registering themselves as thermal cooling devices.

Are you saying that this is all not permitted because they are not part
of a SoC ?

Guenter
Krzysztof Kozlowski Nov. 25, 2024, 3:18 p.m. UTC | #5
On 25/11/2024 16:13, Guenter Roeck wrote:
> On 11/25/24 00:52, Krzysztof Kozlowski wrote:
>> On 13/11/2024 04:05, Guenter Roeck wrote:
>>> On 11/12/24 18:39, Sung-Chi, Li wrote:
>>>> The cros_ec supports reading thermal values from thermal sensors
>>>> connect to it. Add the property '#thermal-sensor-cells' bindings, such
>>>> that thermal framework can recognize cros_ec as a valid thermal device.
>>>>
>>>> Signed-off-by: Sung-Chi, Li <lschyi@chromium.org>
>>>> Acked-by: Conor Dooley <conor.dooley@microchip.com>
>>>> ---
>>>>    Changes in v2:
>>>>      - Add changes for DTS binding.
>>>>    Changes in v3:
>>>>      - Remove unneeded Change-Id tag in commit message.
>>>> ---
>>>
>>> I can't apply this one (not in hwmon space), so
>>>
>>> Acked-by: Guenter Roeck <linux@roeck-us.net>
>>>
>>> with the assumption that Lee will pick it up.
>>
>> This was merged, while I was AFK, so the ship has sailed, but let me
>> state here objection for any future discussions:
>>
>> NAK, this is not a thermal sensor. The commit msg explains what they
>> want to achieve, but that's not a valid reason to add property from
>> different class of devices.
>>
>> This is some hardware/temperature monitoring device or power supply, not
>> part of SoC, not integrated into any SoC thermal zone. Calling it
> 
> I am confused. We have several thermal sensors registering as thermal
> zone, and fan controllers registering themselves as thermal cooling devices.
> 
> Are you saying that this is all not permitted because they are not part
> of a SoC ?


These are fine, because they monitor or cool down the SoC.  Sensor can
be under the die.  Fan for battery or for battery charger also would be
fine, because it is a real cooling device.  It literally cools.

But treating battery charger as cooling device is not correct, IMHO.
Battery charger does not cool anything down and already we have there
properties for managing thermal and current aspects.

BTW, if power supply bindings miss some thermal aspects, then let's grow
the common binding first and agree on common aspects.


Best regards,
Krzysztof
Guenter Roeck Nov. 25, 2024, 4:41 p.m. UTC | #6
On 11/25/24 07:18, Krzysztof Kozlowski wrote:
> On 25/11/2024 16:13, Guenter Roeck wrote:
>> On 11/25/24 00:52, Krzysztof Kozlowski wrote:
>>> On 13/11/2024 04:05, Guenter Roeck wrote:
>>>> On 11/12/24 18:39, Sung-Chi, Li wrote:
>>>>> The cros_ec supports reading thermal values from thermal sensors
>>>>> connect to it. Add the property '#thermal-sensor-cells' bindings, such
>>>>> that thermal framework can recognize cros_ec as a valid thermal device.
>>>>>
>>>>> Signed-off-by: Sung-Chi, Li <lschyi@chromium.org>
>>>>> Acked-by: Conor Dooley <conor.dooley@microchip.com>
>>>>> ---
>>>>>     Changes in v2:
>>>>>       - Add changes for DTS binding.
>>>>>     Changes in v3:
>>>>>       - Remove unneeded Change-Id tag in commit message.
>>>>> ---
>>>>
>>>> I can't apply this one (not in hwmon space), so
>>>>
>>>> Acked-by: Guenter Roeck <linux@roeck-us.net>
>>>>
>>>> with the assumption that Lee will pick it up.
>>>
>>> This was merged, while I was AFK, so the ship has sailed, but let me
>>> state here objection for any future discussions:
>>>
>>> NAK, this is not a thermal sensor. The commit msg explains what they
>>> want to achieve, but that's not a valid reason to add property from
>>> different class of devices.
>>>
>>> This is some hardware/temperature monitoring device or power supply, not
>>> part of SoC, not integrated into any SoC thermal zone. Calling it
>>
>> I am confused. We have several thermal sensors registering as thermal
>> zone, and fan controllers registering themselves as thermal cooling devices.
>>
>> Are you saying that this is all not permitted because they are not part
>> of a SoC ?
> 
> 
> These are fine, because they monitor or cool down the SoC.  Sensor can
> be under the die.  Fan for battery or for battery charger also would be
> fine, because it is a real cooling device.  It literally cools.
> 

Sorry, I don't get the distinction since you specifically refer to the SoC.
How about drive temperatures ? RAM temperatures ? Temperatures reported
by networking chips ? Power supply temperatures ? We have all those registering
thermal zones. The ASUS EC controller driver registers thermal zones
for its temperature sensors. Dell and HP drivers do the same.

> But treating battery charger as cooling device is not correct, IMHO.

Confused. The patch you object to isn't introducing a cooling device,
it is introducing #thermal-sensor-cells. The EC reports temperature
sensor results, and the driver wants to register those as thermal zones.
Yes, it may well be that one of those temperature sensors is close to
a battery charger, but I am not even sure if that is really the case.

> Battery charger does not cool anything down and already we have there
> properties for managing thermal and current aspects.
> 
Agreed, but unless I am missing something that isn't done here.

> BTW, if power supply bindings miss some thermal aspects, then let's grow
> the common binding first and agree on common aspects.
> 

I don't even know how the two patches are associated with power supplies
or battery chargers in the first place. All they try to do is to enable
adding the temperature sensor values reported by the EC in Chromebooks
to thermal zones. I don't recall any previous limitations on the ability
to register thermal sensors as thermal zone with the thermal subsystem,
and I am trying to understand what those limitations are.

So far my approach was "ok, someone wants to register a thermal sensor as
thermal zone - fine, let's do that. We have close to 50 thermal sensors on
a variety of devices - including but not limited to disk drives, memory,
Ethernet controllers, Ethernet PHYs, SFPs, RTCs, and ECs - registering
as thermal zones from hardware monitoring drivers. I don't recall anyone
ever saying "no, you can't do that".

I am trying to understand if some of those are inappropriate and, if so,
why that is the case.

Thanks,
Guenter
Krzysztof Kozlowski Nov. 25, 2024, 5:12 p.m. UTC | #7
On 25/11/2024 17:41, Guenter Roeck wrote:
>>>>>
>>>>> with the assumption that Lee will pick it up.
>>>>
>>>> This was merged, while I was AFK, so the ship has sailed, but let me
>>>> state here objection for any future discussions:
>>>>
>>>> NAK, this is not a thermal sensor. The commit msg explains what they
>>>> want to achieve, but that's not a valid reason to add property from
>>>> different class of devices.
>>>>
>>>> This is some hardware/temperature monitoring device or power supply, not
>>>> part of SoC, not integrated into any SoC thermal zone. Calling it
>>>
>>> I am confused. We have several thermal sensors registering as thermal
>>> zone, and fan controllers registering themselves as thermal cooling devices.
>>>
>>> Are you saying that this is all not permitted because they are not part
>>> of a SoC ?
>>
>>
>> These are fine, because they monitor or cool down the SoC.  Sensor can
>> be under the die.  Fan for battery or for battery charger also would be
>> fine, because it is a real cooling device.  It literally cools.
>>
> 
> Sorry, I don't get the distinction since you specifically refer to the SoC.
> How about drive temperatures ? RAM temperatures ? Temperatures reported

Several of them are part of the SoC, like DDR. But even if they are not,
I agree they could be a thermal sensor, but I would stop before calling
them thermal zones and this patchset leads to such calling.

> by networking chips ? Power supply temperatures ? We have all those registering
> thermal zones. The ASUS EC controller driver registers thermal zones
> for its temperature sensors. Dell and HP drivers do the same.

Maybe we need to clarify that thermal sensors and zones are not specific
to SoCs?

For now all bindings say:
"thermal-sensor: device that measures temperature, has SoC-specific
bindings"


> 
>> But treating battery charger as cooling device is not correct, IMHO.
> 
> Confused. The patch you object to isn't introducing a cooling device,
> it is introducing #thermal-sensor-cells. The EC reports temperature


The next patchset is. This is one of the problems with series from
Sung-Chi, Li - they add hardware description piece by piece, to match
the driver needs, while we expect to see complete hardware picture.

In the complete picture (f:lschyi@chromium.org in lore) you would see
the battery being called a cooling sensor with explanation:

"The cros_ec supports limiting the input current to act as a passive
thermal cooling device. Add the property '#cooling-cells' bindings, such
that thermal framework can recognize cros_ec as a valid thermal cooling
device."



> sensor results, and the driver wants to register those as thermal zones.
> Yes, it may well be that one of those temperature sensors is close to
> a battery charger, but I am not even sure if that is really the case.

Hm, my impression based on very limited commit msg was that it is about
battery.

Probably I don't understand how the hardware looks here, but sorry,
commit msgs and bindings descriptions are for a reason - to help me
understanding it.

> 
>> Battery charger does not cool anything down and already we have there
>> properties for managing thermal and current aspects.
>>
> Agreed, but unless I am missing something that isn't done here.

Yep, I connected two separate patchsets, because they form greater work
of making power supply a cooling device, AFAIU.

> 
>> BTW, if power supply bindings miss some thermal aspects, then let's grow
>> the common binding first and agree on common aspects.
>>
> 
> I don't even know how the two patches are associated with power supplies
> or battery chargers in the first place. All they try to do is to enable
> adding the temperature sensor values reported by the EC in Chromebooks
> to thermal zones. I don't recall any previous limitations on the ability
> to register thermal sensors as thermal zone with the thermal subsystem,
> and I am trying to understand what those limitations are.
> 
> So far my approach was "ok, someone wants to register a thermal sensor as
> thermal zone - fine, let's do that. We have close to 50 thermal sensors on
> a variety of devices - including but not limited to disk drives, memory,
> Ethernet controllers, Ethernet PHYs, SFPs, RTCs, and ECs - registering
> as thermal zones from hardware monitoring drivers. I don't recall anyone
> ever saying "no, you can't do that".
> 
> I am trying to understand if some of those are inappropriate and, if so,
> why that is the case.


Probably would be nice to drop remaining references to SoC from thermal
bindings and just interpret thermal zones as system-wide.

I retract than my objects against sensor cells, but I keep my objection
of changing these bindings piece by piece. This should be one complete
work for bindings so we see what this hardware is supposed to do.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml b/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
index aac8819bd00b..c7d63e3aacd2 100644
--- a/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
+++ b/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
@@ -96,6 +96,9 @@  properties:
   '#gpio-cells':
     const: 2
 
+  '#thermal-sensor-cells':
+    const: 1
+
   gpio-controller: true
 
   typec: