diff mbox series

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

Message ID 20231129124330.519423-1-festevam@gmail.com
State Not Applicable
Headers show
Series [v12,1/4] dt-bindings: thermal-zones: Document critical-action | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Fabio Estevam Nov. 29, 2023, 12:43 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 v11:
- None

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

Comments

Daniel Lezcano Nov. 29, 2023, 1:13 p.m. UTC | #1
On 29/11/2023 13:43, Fabio Estevam 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.
> 
> 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>
> ---

Rafael, ok for you if I pick this series ?
Fabio Estevam Dec. 6, 2023, 12:59 p.m. UTC | #2
Hi Rafael,

On Wed, Nov 29, 2023 at 10:13 AM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:

> Rafael, ok for you if I pick this series ?

Please let us know if Daniel could pick this series.

Thanks
Fabio Estevam Dec. 13, 2023, 11:39 a.m. UTC | #3
Rafael, Daniel,

On Wed, Dec 6, 2023 at 9:59 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Rafael,
>
> On Wed, Nov 29, 2023 at 10:13 AM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>
> > Rafael, ok for you if I pick this series ?
>
> Please let us know if Daniel could pick this series.

Can this be applied for 6.8, please?
Daniel Lezcano Dec. 13, 2023, 12:54 p.m. UTC | #4
On 13/12/2023 12:39, Fabio Estevam wrote:
> Rafael, Daniel,
> 
> On Wed, Dec 6, 2023 at 9:59 AM Fabio Estevam <festevam@gmail.com> wrote:
>>
>> Hi Rafael,
>>
>> On Wed, Nov 29, 2023 at 10:13 AM Daniel Lezcano
>> <daniel.lezcano@linaro.org> wrote:
>>
>>> Rafael, ok for you if I pick this series ?
>>
>> Please let us know if Daniel could pick this series.
> 
> Can this be applied for 6.8, please?

I have applied this series on my bleeding-edge branch, this one will be 
merged with the PM's bleeding branch. After a few days it will migrate 
to linux-next.

If no obvious regression happen it will end up for v6.8

Thank you

   -- Daniel
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
index 4a8dabc48170..dbd52620d293 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