diff mbox series

dt-bindings: thermal: make cooling-maps property optional

Message ID 20200309045411.21859-1-andy.tang@nxp.com
State New
Delegated to: Daniel Lezcano
Headers show
Series dt-bindings: thermal: make cooling-maps property optional | expand

Commit Message

Andy Tang March 9, 2020, 4:54 a.m. UTC
From: Yuantian Tang <andy.tang@nxp.com>

Cooling-maps doesn't have to be a required property because there may
be no cooling device on system, or there are no enough cooling devices for
each thermal zone in multiple thermal zone cases since cooling devices
can't be shared.
So make this property optional to remove such limitations.

For thermal zones with no cooling-maps, there could be critic trips
that can trigger CPU reset or shutdown. So they still can take actions.

Signed-off-by: Yuantian Tang <andy.tang@nxp.com>
---
 Documentation/devicetree/bindings/thermal/thermal.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Lezcano March 16, 2020, 2:52 p.m. UTC | #1
On 09/03/2020 05:54, andy.tang@nxp.com wrote:
> From: Yuantian Tang <andy.tang@nxp.com>
> 
> Cooling-maps doesn't have to be a required property because there may
> be no cooling device on system, or there are no enough cooling devices for
> each thermal zone in multiple thermal zone cases since cooling devices
> can't be shared.
> So make this property optional to remove such limitations.
> 
> For thermal zones with no cooling-maps, there could be critic trips
> that can trigger CPU reset or shutdown. So they still can take actions.
> 
> Signed-off-by: Yuantian Tang <andy.tang@nxp.com>

Amit, I'm about to pick this patch, it will collide with the yaml
conversion changes.
Amit Kucheria March 16, 2020, 4:13 p.m. UTC | #2
On Mon, Mar 16, 2020 at 8:22 PM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> On 09/03/2020 05:54, andy.tang@nxp.com wrote:
> > From: Yuantian Tang <andy.tang@nxp.com>
> >
> > Cooling-maps doesn't have to be a required property because there may
> > be no cooling device on system, or there are no enough cooling devices for
> > each thermal zone in multiple thermal zone cases since cooling devices
> > can't be shared.
> > So make this property optional to remove such limitations.
> >
> > For thermal zones with no cooling-maps, there could be critic trips
> > that can trigger CPU reset or shutdown. So they still can take actions.
> >
> > Signed-off-by: Yuantian Tang <andy.tang@nxp.com>

Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>

>
> Amit, I'm about to pick this patch, it will collide with the yaml
> conversion changes.

Thanks for the headsup. I can fixup v3 when I respin.

However, I've always interpreted this binding as follows:
- cooling-maps should be mandatory for active and passive trip types
otherwise there will be no cooling
- cooling-maps make no sense for critical trip type since we're
invoking system shutdown
- cooling-maps are optional for hot trip types.

Is this your understanding too?

We should be able to enforce this in YAML.

Regards,
Amit
Rob Herring March 23, 2020, 7:56 p.m. UTC | #3
On Mon,  9 Mar 2020 12:54:11 +0800, andy.tang@nxp.com wrote:
> From: Yuantian Tang <andy.tang@nxp.com>
> 
> Cooling-maps doesn't have to be a required property because there may
> be no cooling device on system, or there are no enough cooling devices for
> each thermal zone in multiple thermal zone cases since cooling devices
> can't be shared.
> So make this property optional to remove such limitations.
> 
> For thermal zones with no cooling-maps, there could be critic trips
> that can trigger CPU reset or shutdown. So they still can take actions.
> 
> Signed-off-by: Yuantian Tang <andy.tang@nxp.com>
> ---
>  Documentation/devicetree/bindings/thermal/thermal.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Acked-by: Rob Herring <robh@kernel.org>
Amit Kucheria March 25, 2020, 6:37 a.m. UTC | #4
On Mon, Mar 16, 2020 at 9:43 PM Amit Kucheria <amit.kucheria@linaro.org> wrote:
>
> On Mon, Mar 16, 2020 at 8:22 PM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
> >
> > On 09/03/2020 05:54, andy.tang@nxp.com wrote:
> > > From: Yuantian Tang <andy.tang@nxp.com>
> > >
> > > Cooling-maps doesn't have to be a required property because there may
> > > be no cooling device on system, or there are no enough cooling devices for
> > > each thermal zone in multiple thermal zone cases since cooling devices
> > > can't be shared.
> > > So make this property optional to remove such limitations.
> > >
> > > For thermal zones with no cooling-maps, there could be critic trips
> > > that can trigger CPU reset or shutdown. So they still can take actions.
> > >
> > > Signed-off-by: Yuantian Tang <andy.tang@nxp.com>
>
> Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
>
> >
> > Amit, I'm about to pick this patch, it will collide with the yaml
> > conversion changes.
>
> Thanks for the headsup. I can fixup v3 when I respin.
>
> However, I've always interpreted this binding as follows:
> - cooling-maps should be mandatory for active and passive trip types
> otherwise there will be no cooling
> - cooling-maps make no sense for critical trip type since we're
> invoking system shutdown
> - cooling-maps are optional for hot trip types.
>
> Is this your understanding too?
>
> We should be able to enforce this in YAML.

Rui, Daniel,

What do you think about the above interpretation of the cooling-maps bindings?

Regards,
Amit
Daniel Lezcano March 25, 2020, 9:08 a.m. UTC | #5
On 25/03/2020 07:37, Amit Kucheria wrote:
> On Mon, Mar 16, 2020 at 9:43 PM Amit Kucheria <amit.kucheria@linaro.org> wrote:
>>
>> On Mon, Mar 16, 2020 at 8:22 PM Daniel Lezcano
>> <daniel.lezcano@linaro.org> wrote:
>>>
>>> On 09/03/2020 05:54, andy.tang@nxp.com wrote:
>>>> From: Yuantian Tang <andy.tang@nxp.com>
>>>>
>>>> Cooling-maps doesn't have to be a required property because there may
>>>> be no cooling device on system, or there are no enough cooling devices for
>>>> each thermal zone in multiple thermal zone cases since cooling devices
>>>> can't be shared.
>>>> So make this property optional to remove such limitations.
>>>>
>>>> For thermal zones with no cooling-maps, there could be critic trips
>>>> that can trigger CPU reset or shutdown. So they still can take actions.
>>>>
>>>> Signed-off-by: Yuantian Tang <andy.tang@nxp.com>
>>
>> Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
>>
>>>
>>> Amit, I'm about to pick this patch, it will collide with the yaml
>>> conversion changes.
>>
>> Thanks for the headsup. I can fixup v3 when I respin.
>>
>> However, I've always interpreted this binding as follows:
>> - cooling-maps should be mandatory for active and passive trip types
>> otherwise there will be no cooling
>> - cooling-maps make no sense for critical trip type since we're
>> invoking system shutdown
>> - cooling-maps are optional for hot trip types.
>>
>> Is this your understanding too?
>>
>> We should be able to enforce this in YAML.
> 
> Rui, Daniel,
> 
> What do you think about the above interpretation of the cooling-maps bindings?

Yes, I agree with the interpretation.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt
index ca14ba959e0d..f78bec19ca35 100644
--- a/Documentation/devicetree/bindings/thermal/thermal.txt
+++ b/Documentation/devicetree/bindings/thermal/thermal.txt
@@ -142,11 +142,11 @@  Required properties:
 - trips:		A sub-node which is a container of only trip point nodes
   Type: sub-node	required to describe the thermal zone.
 
+Optional property:
 - cooling-maps:		A sub-node which is a container of only cooling device
   Type: sub-node	map nodes, used to describe the relation between trips
 			and cooling devices.
 
-Optional property:
 - coefficients:		An array of integers (one signed cell) containing
   Type: array		coefficients to compose a linear relation between
   Elem size: one cell	the sensors listed in the thermal-sensors property.