@@ -20,6 +20,7 @@
#include <linux/string.h>
#include <linux/of.h>
#include <linux/suspend.h>
+#include <linux/panic_notifier.h>
#define CREATE_TRACE_POINTS
#include "thermal_trace.h"
@@ -1525,6 +1526,14 @@ static void thermal_reboot_prepare(void)
}
}
+static int thermal_crash_notify(struct notifier_block *nb,
+ unsigned long mode, void *_unused)
+{
+ thermal_reboot_prepare();
+
+ return 0;
+}
+
static int thermal_reboot_notify(struct notifier_block *nb,
unsigned long mode, void *_unused)
{
@@ -1569,6 +1578,10 @@ static struct notifier_block thermal_pm_nb = {
.notifier_call = thermal_pm_notify,
};
+static struct notifier_block thermal_crash_nb = {
+ .notifier_call = thermal_crash_notify,
+};
+
static struct notifier_block thermal_reboot_nb = {
.notifier_call = thermal_reboot_notify,
};
@@ -1611,6 +1624,8 @@ static int __init thermal_init(void)
pr_warn("Thermal: Can not register reboot notifier, return %d\n",
result);
+ atomic_notifier_chain_register(&panic_notifier_list,
+ &thermal_crash_nb);
return 0;
unregister_governors: