lkml.org 
[lkml]   [2020]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] MIPS: Loongson: Add log before power off due to high temperature
Date
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 --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)
--
2.1.0
\
 
 \ /
  Last update: 2020-05-08 13:57    [W:0.049 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site