diff mbox series

[v10,1/4] dt-bindings: thermal-zones: Document critical-action

Message ID 20231006180453.2903342-1-festevam@gmail.com (mailing list archive)
State New, archived
Delegated to: Daniel Lezcano
Headers show
Series [v10,1/4] dt-bindings: thermal-zones: Document critical-action | expand

Commit Message

Fabio Estevam Oct. 6, 2023, 6:04 p.m. UTC
From: Fabio Estevam <festevam@denx.de>

Document the critical-action property to describe the thermal action
the OS should perform after the critical temperature is reached.

The possible values are "shutdown" and "reboot".

The motivation for introducing the critical-action property is that
different systems may need different thermal actions when the critical
temperature is reached.

For example, in a desktop PC, it is desired that a shutdown happens
after the critical temperature is reached.

However, in some embedded cases, such behavior does not suit well,
as the board may be unattended in the field and rebooting may be a
better approach.

The bootloader may also benefit from this new property as it can check
the SoC temperature and in case the temperature is above the critical
point, it can trigger a shutdown or reboot accordingly.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Changes since v9:
- Emphasize that critical-action should be used with care. (Daniel)

 .../bindings/thermal/thermal-zones.yaml          | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Fabio Estevam Oct. 13, 2023, 10:39 a.m. UTC | #1
Hi Daniel,

On Fri, Oct 6, 2023 at 3:05 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> From: Fabio Estevam <festevam@denx.de>
>
> Document the critical-action property to describe the thermal action
> the OS should perform after the critical temperature is reached.

Are you happy with the v10 series?

Thanks
Daniel Lezcano Oct. 15, 2023, 9:54 p.m. UTC | #2
On 13/10/2023 12:39, Fabio Estevam wrote:
> Hi Daniel,
> 
> On Fri, Oct 6, 2023 at 3:05 PM Fabio Estevam <festevam@gmail.com> wrote:
>>
>> From: Fabio Estevam <festevam@denx.de>
>>
>> Document the critical-action property to describe the thermal action
>> the OS should perform after the critical temperature is reached.
> 
> Are you happy with the v10 series?

Yes, I think they are fine except one thing.

The include/linux/reboot.h is changed along with thermal*.c file. IMO it 
is preferable to have separate patch, I mean all reboot.h changes folded 
in a single patch before the thermal_*.c changes. It is actually 
orphaned and we should ask Matti Vaittinen <mazziesaccount@gmail.com> 
its acked-by as he is the author of the code you are changing. 
Otherwise, he will have to ack the patches which contain also thermal 
code which is not its area.
Fabio Estevam Oct. 17, 2023, 12:37 p.m. UTC | #3
Hi Daniel,

On Sun, Oct 15, 2023 at 6:54 PM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:

> > Are you happy with the v10 series?
>
> Yes, I think they are fine except one thing.
>
> The include/linux/reboot.h is changed along with thermal*.c file. IMO it
> is preferable to have separate patch, I mean all reboot.h changes folded
> in a single patch before the thermal_*.c changes. It is actually

I tried to follow your suggestion of putting all reboot.h changes
folded in a single patch before the thermal_*.c changes,
but I don't think I can do this split and maintain a logic patch
separation and bisectability.

> orphaned and we should ask Matti Vaittinen <mazziesaccount@gmail.com>
> its acked-by as he is the author of the code you are changing.
> Otherwise, he will have to ack the patches which contain also thermal
> code which is not its area.

The reason I haven't added Matti on Cc on the series is that
get_maintainer did not list him. Added him on Cc now.

Maybe Matti could help acking patches 2/4 and 3/4?

Full series:

https://lore.kernel.org/linux-pm/20231006180453.2903342-1-festevam@gmail.com/

https://lore.kernel.org/linux-pm/20231006180453.2903342-2-festevam@gmail.com/

https://lore.kernel.org/linux-pm/20231006180453.2903342-3-festevam@gmail.com/

https://lore.kernel.org/linux-pm/20231006180453.2903342-4-festevam@gmail.com/
Fabio Estevam Nov. 13, 2023, 4:03 p.m. UTC | #4
Hi Daniel,

Now that 6.7-rc1 is out, could you please consider taking this series?

Thanks

On Tue, Oct 17, 2023 at 9:37 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Daniel,
>
> On Sun, Oct 15, 2023 at 6:54 PM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>
> > > Are you happy with the v10 series?
> >
> > Yes, I think they are fine except one thing.
> >
> > The include/linux/reboot.h is changed along with thermal*.c file. IMO it
> > is preferable to have separate patch, I mean all reboot.h changes folded
> > in a single patch before the thermal_*.c changes. It is actually
>
> I tried to follow your suggestion of putting all reboot.h changes
> folded in a single patch before the thermal_*.c changes,
> but I don't think I can do this split and maintain a logic patch
> separation and bisectability.
>
> > orphaned and we should ask Matti Vaittinen <mazziesaccount@gmail.com>
> > its acked-by as he is the author of the code you are changing.
> > Otherwise, he will have to ack the patches which contain also thermal
> > code which is not its area.
>
> The reason I haven't added Matti on Cc on the series is that
> get_maintainer did not list him. Added him on Cc now.
>
> Maybe Matti could help acking patches 2/4 and 3/4?
>
> Full series:
>
> https://lore.kernel.org/linux-pm/20231006180453.2903342-1-festevam@gmail.com/
>
> https://lore.kernel.org/linux-pm/20231006180453.2903342-2-festevam@gmail.com/
>
> https://lore.kernel.org/linux-pm/20231006180453.2903342-3-festevam@gmail.com/
>
> https://lore.kernel.org/linux-pm/20231006180453.2903342-4-festevam@gmail.com/
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
index 4f3acdc4dec0..f88fbafecb01 100644
--- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
+++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
@@ -75,6 +75,22 @@  patternProperties:
           framework and assumes that the thermal sensors in this zone
           support interrupts.
 
+      critical-action:
+        $ref: /schemas/types.yaml#/definitions/string
+        description: |
+          The action the OS should perform after the critical temperature is reached.
+          By default the system will shutdown as a safe action to prevent damage
+          to the hardware, if the property is not set.
+          The shutdown action should be always the default and preferred one.
+          Choose 'reboot' with care, as the hardware may be in thermal stress,
+          thus leading to infinite reboots that may cause damage to the hardware.
+          Make sure the firmware/bootloader will act as the last resort and take
+          over the thermal control.
+
+        enum:
+          - shutdown
+          - reboot
+
       thermal-sensors:
         $ref: /schemas/types.yaml#/definitions/phandle-array
         maxItems: 1