From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66A8BC54EBE for ; Fri, 13 Jan 2023 12:20:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241159AbjAMMUI (ORCPT ); Fri, 13 Jan 2023 07:20:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241138AbjAMMTc (ORCPT ); Fri, 13 Jan 2023 07:19:32 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CE2278258 for ; Fri, 13 Jan 2023 04:12:50 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id ay40so15145915wmb.2 for ; Fri, 13 Jan 2023 04:12:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=k2B0hsASFUkHWI+dtbJoqoXBrOmDXx4P5iE4tDoIv9Y=; b=r5LMJrP1xmHoLFxCeIJz1DlWNsBJgQSDhoBQsjNX1FZGWGcX5q6iezTlqp7iJ7dxsj 2l30AzU3QT015HNw22K27UXC69kTC9Dx3zjaT4zaSywPtt2UmipEhx2YBtCQbTSGOpFa SVBhIPlb1y5YIsk0cxJGkLQuVIdSEnK9KyyCOIKergfjR9O/STPWjKP0B6cjspqe0DJ5 ufpKjggsU9ht6XRWi5FqyRLTAF0q/6DILqpjRUnnENWhFyEL2Sn2COJYru4UULhFeCzs VKq9rKeYlp0KZ6KWzId19etifFPGkY4nLW/sjcNxqjKFA2MvjEAz/28i86FUaNO5dHtc TJLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=k2B0hsASFUkHWI+dtbJoqoXBrOmDXx4P5iE4tDoIv9Y=; b=JOSHj2c8N7N5S6jPEGI0DMSaGvazHU9JFlQFNzpmn5g8QisBaqvevjfPedm3I++A3o Fkx/8iRj2l2ftQS6fHoEEYnQvk/OcHH+butdIRhrTHAE+gtXDg1CWcjeFb1a8tJdtM8h 3c4gUbiLm9Y2ZbYR3A2gan+HMQVdU1LTarcwZKRn4KWYGfCi+x9THew0oXgIa24CCtUI 9VsGfa9FEBqBQRgIEqm/2024bD29xqn0u/6VTbgruBTF3nLkkwvcbqG0/HNW6uXSM2rr Fszbmjeoiw8ka8+Wn7Ze+GxaxmwwtLxvJ7dKBSoThJ5nv/a+J/Na06IPQBWbUuCI8qPe Qs8g== X-Gm-Message-State: AFqh2krp2uPXgJx6HY/5Cq1t5Cp7AUEtxyudPPziHjmrsTj4P2+ffpkW LpmSmPtR3J6xIxn/EH0PMB0Q9g== X-Google-Smtp-Source: AMrXdXu2ltpUhMmjl2uUB9itPccs5udi7WYLCpJAPI1VbQ0Ahcuu4yLeptqX5/gWOIqo97PCCNz40w== X-Received: by 2002:a7b:c851:0:b0:3d9:f067:1c32 with SMTP id c17-20020a7bc851000000b003d9f0671c32mr13643754wml.29.1673611968714; Fri, 13 Jan 2023 04:12:48 -0800 (PST) Received: from [192.168.10.46] (146725694.box.freepro.com. [130.180.211.218]) by smtp.googlemail.com with ESMTPSA id t9-20020a05600c198900b003d9e74dd9b2sm22536878wmq.9.2023.01.13.04.12.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Jan 2023 04:12:48 -0800 (PST) Message-ID: Date: Fri, 13 Jan 2023 13:12:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 3/3] thermal/drivers/intel: Use generic trip points int340x Content-Language: en-US To: "Zhang, Rui" , "rafael@kernel.org" Cc: "srinivas.pandruvada@linux.intel.com" , "linux-pm@vger.kernel.org" , "daniel.lezcano@kernel.org" , "linux-kernel@vger.kernel.org" , "christophe.jaillet@wanadoo.fr" , "linux-acpi@vger.kernel.org" , "amitk@kernel.org" References: <20230110151745.2546131-1-daniel.lezcano@linaro.org> <20230110151745.2546131-4-daniel.lezcano@linaro.org> <4f461027be209156d6d9f26870748f204ff4184b.camel@intel.com> From: Daniel Lezcano In-Reply-To: <4f461027be209156d6d9f26870748f204ff4184b.camel@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Hi Rui; thanks for testing and your comments On 13/01/2023 12:41, Zhang, Rui wrote: > On Tue, 2023-01-10 at 16:17 +0100, Daniel Lezcano wrote: >> The thermal framework gives the possibility to register the trip >> points with the thermal zone. When that is done, no get_trip_* ops >> are >> needed and they can be removed. >> >> Convert the ops content logic into generic trip points and register >> them with the thermal zone. >> >> In order to consolidate the code, use the ACPI thermal framework API >> to fill the generic trip point from the ACPI tables. >> >> It has been tested on a Intel i7-8650U - x280 with the INT3400, the >> PCH, ACPITZ, and x86_pkg_temp. No regression observed so far. >> >> Signed-off-by: Daniel Lezcano >> --- >> V3: >> - The driver Kconfig option selects CONFIG_THERMAL_ACPI >> - Change the initialization to use GTSH for the hysteresis on >> all the trip points >> >> Signed-off-by: Daniel Lezcano >> --- >> drivers/thermal/intel/int340x_thermal/Kconfig | 1 + >> .../int340x_thermal/int340x_thermal_zone.c | 177 ++++---------- >> ---- [ ... ] >> -static int int340x_thermal_get_trip_hyst(struct thermal_zone_device >> *zone, >> - int trip, int *temp) >> -{ >> - struct int34x_thermal_zone *d = zone->devdata; >> - acpi_status status; >> - unsigned long long hyst; >> - >> - status = acpi_evaluate_integer(d->adev->handle, "GTSH", NULL, >> &hyst); >> - if (ACPI_FAILURE(status)) >> - *temp = 0; >> - else >> - *temp = hyst * 100; > > The previous code returns hyst * 100. > But the new API retuurns hyst directly. > > -/sys/class/thermal/thermal_zone2/trip_point_4_hyst:2000 > +/sys/class/the > rmal/thermal_zone2/trip_point_4_hyst:20 > > Is this done on purpose? No, it is an error. The function thermal_acpi_trip_gtsh() should do: return deci_kelvin_to_millicelsius(hyst); -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog