Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4359280pxu; Mon, 21 Dec 2020 10:23:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwajP+oIJ3UETwThVyinUeRyCBicyn9VZHWCCKAgjH5KIad+n5DB/VuAUwlHiXjQAWHU10h X-Received: by 2002:a17:906:f894:: with SMTP id lg20mr16486747ejb.348.1608574982271; Mon, 21 Dec 2020 10:23:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608574982; cv=none; d=google.com; s=arc-20160816; b=Q6G5cWqoxFQV9ofeT1zGvOB7LCd/GYqY93mRVWKN6SG2QNZNudDPV0qyvTbnixGhsj pDwTVhA3aYMmLDF5R21wJ6/wPpPvLlpD+PkhVPJr7Ox2i7zJ7gCmQ+JwS9YspjfSJUQU /nZhhSAcgogEghCEtVT9mpYIRBWPS5XRl33W0jJGqCyvlSqE31qBuoNxomgoisEViZpe vBaIXBdSFSSPCYdoB7ERicfS1+Cpj7j4ZDNYB4AX0WAwsmj2fo5S+KVcXOy5cUySYR8H fwO59nLSKG1gjhdqHmN2z3Rd/6Ox+xI+r2AzEjbCvpAPrOi93hyCJfTkCDhZjA5JzaJx 7eog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=PWkuqGttRqaAWl7rLMPpmQ8BaJ8J691WwUxkaIeGvJo=; b=Iyn5wM8fU5sl5qX6e1NvIWhPH8++9IcKjMgk/UEGYOF3mEaTyPSqei7k/tgCEipC6x JMIUPUfBCZUQHMxSJEOv9Cj9oBz6qSM1ytmy6mE0uMdVh21gEqq906IkQ4lsR4ai46Vr nu45yc3SUkKNNnqNK5bwK0jMA1QA6nTKV6FwmYtIJZdaMg/b/gZzLiBrRBAQh+t6YCS1 qsXba/UiiEXxG6KWJTZb2RLJuSQU2WQAdSpRzNnTwEx4Yi+Vh+ktTeuQfBhHsFI5P17w HP8fr5eqS0VswUDBsVnI7TaRlgMVG8ZCHtlv8npDvBOlbn+CqBjueViHMm6i78wgDgDk AbzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Pw3Y/B1b"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qu25si9238243ejb.146.2020.12.21.10.22.39; Mon, 21 Dec 2020 10:23:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Pw3Y/B1b"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726618AbgLUSV2 (ORCPT + 99 others); Mon, 21 Dec 2020 13:21:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbgLUSV2 (ORCPT ); Mon, 21 Dec 2020 13:21:28 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2FF1C061793 for ; Mon, 21 Dec 2020 10:20:47 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id m12so25920696lfo.7 for ; Mon, 21 Dec 2020 10:20:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=PWkuqGttRqaAWl7rLMPpmQ8BaJ8J691WwUxkaIeGvJo=; b=Pw3Y/B1bOAivORcFJlAOiE/TgmnVI0I1sU9H5ia7NuFe4VXUTfiApqcVow14tFqldX OGbFlIRh7PQA3vo8JnOyrl7+IDEzOeokd7ThHFiJuZkN8EHu75ngLXvY+tdPooVNRG9x sQcN8CjmYDLuspof92kxN6UIlh8Hly6xH9nHx7Jf/NBuNwip1HNTG9c/Bwcsc+uOI74r tGEAHrT0q7D9VJyPJgGxflmhGFzlmPRMXYsh11LEuUyMcWHvmFFou53APCj7JTMwHk2a E/zQoi0zgnhefzFfrJ1q064KIl+0WGIYByP3zR4JN4Woh8kebctrUblLjtSKL86qioDI UYDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PWkuqGttRqaAWl7rLMPpmQ8BaJ8J691WwUxkaIeGvJo=; b=e2FG6mEh78QD8TPbtfXYz9DoZkWMo6E+3foc3Ow2r5QwrBE9kMaHjDfcFK+1ETcka+ alWOO0mTHArJlTDq9NWb8ClzFfImhObgvbC1svj4Qvvfva7iCgxLw9/PsUIaq/r8jghs 4euiK5FTYq21+rfeN3op7mglWeuy/QYcQb4IWz1HQTZJrO5N/UsWFDBFM1t0n+qaHlOa CV6IZgPGjewwc+IYVz+g9Me6gW4+Bj2Y+sgYodx0Vzsgp1futOg1MQRiE4Gdlo6Cvy3F Sa8VuGP8pbuVs5WSYqQ532hmMuguPsgfBJRbrJ3lJRpp3WaRUKJPzjZWZaCIlEoaMWHd R+0w== X-Gm-Message-State: AOAM531XS6aFLWMOMet847PblGfj0f0NUHqTSSu9uMDYT5K5gQB5Am3+ na0Dj/+ZTxMjRaHJ6kCDrb/NMVUZS46pgw== X-Received: by 2002:a50:955b:: with SMTP id v27mr15811429eda.324.1608559167996; Mon, 21 Dec 2020 05:59:27 -0800 (PST) Received: from [192.168.0.41] (lns-bzn-59-82-252-148-164.adsl.proxad.net. [82.252.148.164]) by smtp.googlemail.com with ESMTPSA id a6sm28826279edv.74.2020.12.21.05.59.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Dec 2020 05:59:27 -0800 (PST) Subject: Re: [PATCH 1/2] thermal: int340x: Add critical callback to override default shutdown behavior To: Kai-Heng Feng , rui.zhang@intel.com, amitk@kernel.org Cc: andrzej.p@collabora.com, mjg59@google.com, srinivas.pandruvada@linux.intel.com, Bartlomiej Zolnierkiewicz , Peter Kaestle , Gayatri Kammela , Akinobu Mita , Andy Shevchenko , Andrew Morton , "open list:THERMAL" , open list References: <20201221135206.17671-1-kai.heng.feng@canonical.com> From: Daniel Lezcano Message-ID: <20e74dc1-1f1d-6dee-19a7-e9a975b66606@linaro.org> Date: Mon, 21 Dec 2020 14:59:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201221135206.17671-1-kai.heng.feng@canonical.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/12/2020 14:52, Kai-Heng Feng wrote: > We are seeing thermal shutdown on Intel based mobile workstations, the > shutdown happens during the first trip handle in > thermal_zone_device_register(): > kernel: thermal thermal_zone15: critical temperature reached (101 C), shutting down > > However, we shouldn't do a thermal shutdown here, since > 1) We may want to use a dedicated daemon, Intel's thermald in this case, > to handle thermal shutdown. > > 2) For ACPI based system, _CRT doesn't mean shutdown unless it's inside > ThermalZone namespace. ACPI Spec, 11.4.4 _CRT (Critical Temperature): > "... If this object it present under a device, the device’s driver > evaluates this object to determine the device’s critical cooling > temperature trip point. This value may then be used by the device’s > driver to program an internal device temperature sensor trip point." > > So a "critical trip" here merely means we should take a more aggressive > cooling method. > > As int340x device isn't present under ACPI ThermalZone, override the > default .critical callback to prevent surprising thermal shutdown. > > Signed-off-by: Kai-Heng Feng I'll submit those changes for v5.11-rc1 and change the subject by: thermal: int340x: Fix unexpected shutdown at critical temperature thermal: pch: Fix unexpected shutdown at critical temperature Sounds good ? > --- > drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 6 ++++++ > .../thermal/intel/int340x_thermal/int340x_thermal_zone.c | 6 ++++++ > 2 files changed, 12 insertions(+) > > diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c > index 823354a1a91a..9778a6dba939 100644 > --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c > +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c > @@ -431,9 +431,15 @@ static int int3400_thermal_change_mode(struct thermal_zone_device *thermal, > return result; > } > > +static void int3400_thermal_critical(struct thermal_zone_device *thermal) > +{ > + dev_dbg(&thermal->device, "%s: critical temperature reached\n", thermal->type); > +} > + > static struct thermal_zone_device_ops int3400_thermal_ops = { > .get_temp = int3400_thermal_get_temp, > .change_mode = int3400_thermal_change_mode, > + .critical = int3400_thermal_critical, > }; > > static struct thermal_zone_params int3400_thermal_params = { > diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c > index 6e479deff76b..d1248ba943a4 100644 > --- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c > +++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c > @@ -146,12 +146,18 @@ static int int340x_thermal_get_trip_hyst(struct thermal_zone_device *zone, > return 0; > } > > +static void int340x_thermal_critical(struct thermal_zone_device *zone) > +{ > + dev_dbg(&zone->device, "%s: critical temperature reached\n", zone->type); > +} > + > static struct thermal_zone_device_ops int340x_thermal_zone_ops = { > .get_temp = int340x_thermal_get_zone_temp, > .get_trip_temp = int340x_thermal_get_trip_temp, > .get_trip_type = int340x_thermal_get_trip_type, > .set_trip_temp = int340x_thermal_set_trip_temp, > .get_trip_hyst = int340x_thermal_get_trip_hyst, > + .critical = int340x_thermal_critical, > }; > > static int int340x_thermal_get_trip_config(acpi_handle handle, char *name, > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog