diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-01-02 13:45:36 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-01-02 13:45:36 +0100 |
commit | d654362d53a83ef3b921f3d06812e12290646a90 (patch) | |
tree | afc2e5caa53ea6f5b74526acc86ccb59572e9625 /drivers/thermal/thermal_core.c | |
parent | a3cd6db4cc2ed70fc3468cdb5eb20745e7fefba9 (diff) | |
parent | 5314b1543787e6cd5d248186fcfd5c5fc4ca2146 (diff) | |
download | linux-stable-d654362d53a83ef3b921f3d06812e12290646a90.tar.gz linux-stable-d654362d53a83ef3b921f3d06812e12290646a90.tar.bz2 linux-stable-d654362d53a83ef3b921f3d06812e12290646a90.zip |
Merge tag 'thermal-v6.8-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux into thermal
Merge thermal control material for 6.8-rc1 from Daniel Lezcano:
"- Converted Mediatek Thermal to the json-schema (Rafał Miłecki)
- Fixed DT bindings issue on Loongson (Binbin Zhou)
- Fixed returning NULL instead of -ENODEV on Loogsoo (Binbin Zhou)
- Added the DT binding for the tsens on SM8650 platform (Neil Armstrong)
- Added a reboot on critical option feature (Fabio Estevam)
- Made usage of DEFINE_SIMPLE_DEV_PM_OPS on AmLogic (Uwe Kleine-König)
- Added the D1/T113s THS controller support on Sun8i (Maxim Kiselev)
- Fixed example in the DT binding for QCom SPMI (Johan Hovold)
- Fixed compilation warning for the tmon utility (Florian Eckert)
- Added interrupt based configuration on Exynos along with a set of
related cleanups (Mateusz Majewski)"
* tag 'thermal-v6.8-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (24 commits)
thermal/drivers/exynos: Use set_trips ops
thermal/drivers/exynos: Use BIT wherever possible
thermal/drivers/exynos: Split initialization of TMU and the thermal zone
thermal/drivers/exynos: Stop using the threshold mechanism on Exynos 4210
thermal/drivers/exynos: Simplify regulator (de)initialization
thermal/drivers/exynos: Handle devm_regulator_get_optional return value correctly
thermal/drivers/exynos: Wwitch from workqueue-driven interrupt handling to threaded interrupts
thermal/drivers/exynos: Drop id field
thermal/drivers/exynos: Remove an unnecessary field description
tools/thermal/tmon: Fix compilation warning for wrong format
dt-bindings: thermal: qcom-spmi-adc-tm5/hc: Clean up examples
dt-bindings: thermal: qcom-spmi-adc-tm5/hc: Fix example node names
thermal/drivers/sun8i: Add D1/T113s THS controller support
dt-bindings: thermal: sun8i: Add binding for D1/T113s THS controller
thermal: amlogic: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions
thermal: amlogic: Make amlogic_thermal_disable() return void
thermal/thermal_of: Allow rebooting after critical temp
reboot: Introduce thermal_zone_device_critical_reboot()
thermal/core: Prepare for introduction of thermal reboot
dt-bindings: thermal-zones: Document critical-action
...
Diffstat (limited to 'drivers/thermal/thermal_core.c')
-rw-r--r-- | drivers/thermal/thermal_core.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 58958288b559..fa88d8707241 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -318,21 +318,34 @@ void thermal_governor_update_tz(struct thermal_zone_device *tz, tz->governor->update_tz(tz, reason); } -void thermal_zone_device_critical(struct thermal_zone_device *tz) +static void thermal_zone_device_halt(struct thermal_zone_device *tz, bool shutdown) { /* * poweroff_delay_ms must be a carefully profiled positive value. * Its a must for forced_emergency_poweroff_work to be scheduled. */ int poweroff_delay_ms = CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS; + const char *msg = "Temperature too high"; - dev_emerg(&tz->device, "%s: critical temperature reached, " - "shutting down\n", tz->type); + dev_emerg(&tz->device, "%s: critical temperature reached\n", tz->type); - hw_protection_shutdown("Temperature too high", poweroff_delay_ms); + if (shutdown) + hw_protection_shutdown(msg, poweroff_delay_ms); + else + hw_protection_reboot(msg, poweroff_delay_ms); +} + +void thermal_zone_device_critical(struct thermal_zone_device *tz) +{ + thermal_zone_device_halt(tz, true); } EXPORT_SYMBOL(thermal_zone_device_critical); +void thermal_zone_device_critical_reboot(struct thermal_zone_device *tz) +{ + thermal_zone_device_halt(tz, false); +} + static void handle_critical_trips(struct thermal_zone_device *tz, const struct thermal_trip *trip) { |