diff mbox series

[3/3] MIPS: Loongson: Add log before power off due to high temperature

Message ID 1588938904-924-4-git-send-email-yangtiezhu@loongson.cn (mailing list archive)
State Superseded
Headers show
Series MIPS: Loongson: Fix some issues of cpu_hwmon.c | expand

Commit Message

Tiezhu Yang May 8, 2020, 11:55 a.m. UTC
When the CPU temperature is too high, it is better to print a log before
power off, this is useful when analysis the abnormal issues.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/platform/mips/cpu_hwmon.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/platform/mips/cpu_hwmon.c b/drivers/platform/mips/cpu_hwmon.c
index 7b4bde1..6dfecd8 100644
--- a/drivers/platform/mips/cpu_hwmon.c
+++ b/drivers/platform/mips/cpu_hwmon.c
@@ -162,10 +162,12 @@  static void do_thermal_timer(struct work_struct *work)
 			temp_max = value;
 	}
 
-	if (temp_max <= CPU_THERMAL_THRESHOLD)
+	if (temp_max <= CPU_THERMAL_THRESHOLD) {
 		schedule_delayed_work(&thermal_work, msecs_to_jiffies(5000));
-	else
+	} else {
+		pr_emerg("Power off due to high temperature: %d\n", value);
 		orderly_poweroff(true);
+	}
 }
 
 static int __init loongson_hwmon_init(void)