From patchwork Fri May 8 11:55:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 11536397 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A3F17159A for ; Fri, 8 May 2020 11:55:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 955B12145D for ; Fri, 8 May 2020 11:55:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726950AbgEHLzM (ORCPT ); Fri, 8 May 2020 07:55:12 -0400 Received: from mail.loongson.cn ([114.242.206.163]:49586 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726636AbgEHLzM (ORCPT ); Fri, 8 May 2020 07:55:12 -0400 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxX92ZSLVebikyAA--.9S5; Fri, 08 May 2020 19:55:07 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer , Huacai Chen , Jiaxun Yang Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li Subject: [PATCH 3/3] MIPS: Loongson: Add log before power off due to high temperature Date: Fri, 8 May 2020 19:55:04 +0800 Message-Id: <1588938904-924-4-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1588938904-924-1-git-send-email-yangtiezhu@loongson.cn> References: <1588938904-924-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf9DxX92ZSLVebikyAA--.9S5 X-Coremail-Antispam: 1UD129KBjvdXoWrZF4UKF4kWFy3ZF48Gr1ftFb_yoWfuwc_uF W0grnrGr1rKwn0yr12kFnxuryjk34kWF1xZr1Iq39Ik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el.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org 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 --- 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)