Message ID | 20231119130551.2416869-1-festevam@gmail.com |
---|---|
State | Not Applicable |
Headers | show |
Series | [v11,1/4] dt-bindings: thermal-zones: Document critical-action | expand |
Context | Check | Description |
---|---|---|
robh/checkpatch | success | |
robh/patch-applied | success | |
robh/dtbs-check | warning | build log |
robh/dt-meta-schema | success |
On 19/11/2023 14:05, Fabio Estevam wrote: > From: Fabio Estevam <festevam@denx.de> > > Introduce thermal_zone_device_critical_reboot() to trigger an > emergency reboot. > > It is a counterpart of thermal_zone_device_critical() with the > difference that it will force a reboot instead of shutdown. > > The motivation for doing this is to allow the thermal subystem > to trigger a reboot when the temperature reaches the critical > temperature. > > Signed-off-by: Fabio Estevam <festevam@denx.de> > --- [ ... ] > diff --git a/include/linux/thermal.h b/include/linux/thermal.h > index cee814d5d1ac..3644326b18ac 100644 > --- a/include/linux/thermal.h > +++ b/include/linux/thermal.h > @@ -361,6 +361,7 @@ int thermal_zone_get_offset(struct thermal_zone_device *tz); > int thermal_zone_device_enable(struct thermal_zone_device *tz); > int thermal_zone_device_disable(struct thermal_zone_device *tz); > void thermal_zone_device_critical(struct thermal_zone_device *tz); > +void thermal_zone_device_critical_reboot(struct thermal_zone_device *tz); It is more relevant to keep it private to the thermal core as there is no user of it except in the thermal-of. IOW in thermal_core.h [ ... ]
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