@@ -369,7 +369,8 @@ void thermal_governor_update_tz(struct thermal_zone_device *tz,
tz->governor->update_tz(tz, reason);
}
-static void thermal_zone_device_halt(struct thermal_zone_device *tz, bool shutdown)
+static void thermal_zone_device_halt(struct thermal_zone_device *tz,
+ enum hw_protection_action action)
{
/*
* poweroff_delay_ms must be a carefully profiled positive value.
@@ -380,21 +381,23 @@ static void thermal_zone_device_halt(struct thermal_zone_device *tz, bool shutdo
dev_emerg(&tz->device, "%s: critical temperature reached\n", tz->type);
- if (shutdown)
- hw_protection_shutdown(msg, poweroff_delay_ms);
- else
- hw_protection_reboot(msg, poweroff_delay_ms);
+ __hw_protection_trigger(msg, poweroff_delay_ms, action);
}
void thermal_zone_device_critical(struct thermal_zone_device *tz)
{
- thermal_zone_device_halt(tz, true);
+ thermal_zone_device_halt(tz, HWPROT_ACT_DEFAULT);
}
EXPORT_SYMBOL(thermal_zone_device_critical);
+void thermal_zone_device_critical_shutdown(struct thermal_zone_device *tz)
+{
+ thermal_zone_device_halt(tz, HWPROT_ACT_SHUTDOWN);
+}
+
void thermal_zone_device_critical_reboot(struct thermal_zone_device *tz)
{
- thermal_zone_device_halt(tz, false);
+ thermal_zone_device_halt(tz, HWPROT_ACT_REBOOT);
}
static void handle_critical_trips(struct thermal_zone_device *tz,
@@ -262,6 +262,7 @@ int thermal_build_list_of_policies(char *buf);
void __thermal_zone_device_update(struct thermal_zone_device *tz,
enum thermal_notify_event event);
void thermal_zone_device_critical_reboot(struct thermal_zone_device *tz);
+void thermal_zone_device_critical_shutdown(struct thermal_zone_device *tz);
void thermal_governor_update_tz(struct thermal_zone_device *tz,
enum thermal_notify_event reason);
@@ -397,9 +397,12 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node *
of_ops.should_bind = thermal_of_should_bind;
ret = of_property_read_string(np, "critical-action", &action);
- if (!ret)
- if (!of_ops.critical && !strcasecmp(action, "reboot"))
+ if (!ret && !of_ops.critical) {
+ if (!strcasecmp(action, "reboot"))
of_ops.critical = thermal_zone_device_critical_reboot;
+ else if (!strcasecmp(action, "shutdown"))
+ of_ops.critical = thermal_zone_device_critical_shutdown;
+ }
tz = thermal_zone_device_register_with_trips(np->name, trips, ntrips,
data, &of_ops, &tzp,