[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ddcfbd2e-2ea0-9305-96c4-8127181cdd8c@linaro.org>
Date: Fri, 13 Jan 2023 13:12:47 +0100
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: "Zhang, Rui" <rui.zhang@...el.com>,
"rafael@...nel.org" <rafael@...nel.org>
Cc: "srinivas.pandruvada@...ux.intel.com"
<srinivas.pandruvada@...ux.intel.com>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"daniel.lezcano@...nel.org" <daniel.lezcano@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"christophe.jaillet@...adoo.fr" <christophe.jaillet@...adoo.fr>,
"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
"amitk@...nel.org" <amitk@...nel.org>
Subject: Re: [PATCH 3/3] thermal/drivers/intel: Use generic trip points
int340x
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 <daniel.lezcano@...nel.org>
>> ---
>> 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 <daniel.lezcano@...aro.org>
>> ---
>> 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);
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
Powered by blists - more mailing lists