[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ad3bc3e4-bff8-43be-b853-3d1ca0b5d0de@linaro.org>
Date: Thu, 22 Feb 2024 16:36:40 +0100
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Linux PM <linux-pm@...r.kernel.org>
Cc: Lukasz Luba <lukasz.luba@....com>, LKML <linux-kernel@...r.kernel.org>,
Stanislaw Gruszka <stanislaw.gruszka@...ux.intel.com>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Zhang Rui <rui.zhang@...el.com>, netdev@...r.kernel.org,
Ido Schimmel <idosch@...dia.com>, Petr Machata <petrm@...dia.com>,
Miri Korenblit <miriam.rachel.korenblit@...el.com>,
linux-wireless@...r.kernel.org, Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Manaf Meethalavalappu Pallikunhi <quic_manafm@...cinc.com>
Subject: Re: [PATCH v2 2/9] thermal: core: Add flags to struct thermal_trip
On 22/02/2024 15:36, Daniel Lezcano wrote:
> On 12/02/2024 19:31, Rafael J. Wysocki wrote:
>> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>>
>> In order to allow thermal zone creators to specify the writability of
>> trip point temperature and hysteresis on a per-trip basis, add a flags
>> field to struct thermal_trip and define flags to represent the desired
>> trip properties.
>>
>> Also make thermal_zone_device_register_with_trips() set the
>> THERMAL_TRIP_FLAG_RW_TEMP flag for all trips covered by the writable
>> trips mask passed to it and modify the thermal sysfs code to look at
>> the trip flags instead of using the writable trips mask directly or
>> checking the presence of the .set_trip_hyst() zone callback.
>>
>> Additionally, make trip_point_temp_store() and trip_point_hyst_store()
>> fail with an error code if the trip passed to one of them has
>> THERMAL_TRIP_FLAG_RW_TEMP or THERMAL_TRIP_FLAG_RW_HYST,
>> respectively, clear in its flags.
>>
>> No intentional functional impact.
>>
>> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>> ---
>> ===================================================================
>> --- linux-pm.orig/drivers/thermal/thermal_core.c
>> +++ linux-pm/drivers/thermal/thermal_core.c
>> @@ -1356,13 +1356,23 @@ thermal_zone_device_register_with_trips(
>> tz->devdata = devdata;
>> tz->trips = trips;
>> tz->num_trips = num_trips;
[ ... ]
>> + if (num_trips > 0) {
>
> Is this check really necessary? for_each_trip() should exit immediately
> if there is no trip points.
Given that is removed in patch 9/9, please ignore this comment
>> + struct thermal_trip *trip;
>> +
>> + for_each_trip(tz, trip) {
>> + if (mask & 1)
>> + trip->flags |= THERMAL_TRIP_FLAG_RW_TEMP;
>> +
>> + mask >>= 1;
>> + }
>> + }
[ ... ]
--
<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