[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1588938904-924-4-git-send-email-yangtiezhu@loongson.cn>
Date: Fri, 8 May 2020 19:55:04 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Huacai Chen <chenhc@...ote.com>,
Jiaxun Yang <jiaxun.yang@...goat.com>
Cc: linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
Xuefeng Li <lixuefeng@...ngson.cn>
Subject: [PATCH 3/3] MIPS: Loongson: Add log before power off due to high temperature
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@...ngson.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
Powered by blists - more mailing lists