From patchwork Thu Jan 21 08:49:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai-Heng Feng X-Patchwork-Id: 1429689 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DLx0T2t5Wz9sW1; Thu, 21 Jan 2021 19:49:45 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1l2Vew-0001dd-Cz; Thu, 21 Jan 2021 08:49:42 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l2Veu-0001bo-7x for kernel-team@lists.ubuntu.com; Thu, 21 Jan 2021 08:49:40 +0000 Received: from 1-171-232-235.dynamic-ip.hinet.net ([1.171.232.235] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l2Vet-0000Nn-Dm for kernel-team@lists.ubuntu.com; Thu, 21 Jan 2021 08:49:40 +0000 From: Kai-Heng Feng To: kernel-team@lists.ubuntu.com Subject: [G/Unstable/OEM-5.10] [PATCH 7/7] thermal: intel: pch: Fix unexpected shutdown at critical temperature Date: Thu, 21 Jan 2021 16:49:02 +0800 Message-Id: <20210121084902.672855-9-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210121084902.672855-1-kai.heng.feng@canonical.com> References: <20210121084902.672855-1-kai.heng.feng@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1906168 Like previous patch, the intel_pch_thermal device is not in ACPI ThermalZone namespace, so a critical trip doesn't mean shutdown. Override the default .critical callback to prevent surprising thermal shutdoown. Signed-off-by: Kai-Heng Feng Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20201221172345.36976-2-kai.heng.feng@canonical.com (cherry picked from commit 03671968d0bf2db598f7e3aa98f190b76c1bb4ff linux-next) Signed-off-by: Kai-Heng Feng --- drivers/thermal/intel/intel_pch_thermal.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/intel/intel_pch_thermal.c index 56401fd4708d..7bccf588c15e 100644 --- a/drivers/thermal/intel/intel_pch_thermal.c +++ b/drivers/thermal/intel/intel_pch_thermal.c @@ -263,10 +263,16 @@ static int pch_get_trip_temp(struct thermal_zone_device *tzd, int trip, int *tem return 0; } +static void pch_critical(struct thermal_zone_device *tzd) +{ + dev_dbg(&tzd->device, "%s: critical temperature reached\n", tzd->type); +} + static struct thermal_zone_device_ops tzd_ops = { .get_temp = pch_thermal_get_temp, .get_trip_type = pch_get_trip_type, .get_trip_temp = pch_get_trip_temp, + .critical = pch_critical, }; enum board_ids {