diff mbox series

[v2,6/9] wifi: iwlwifi: mvm: Set THERMAL_TRIP_FLAG_RW_TEMP directly

Message ID 22182690.EfDdHjke4D@kreacher
State New
Headers show
Series thermal: Writable trip points handling rework | expand

Commit Message

Rafael J. Wysocki Feb. 12, 2024, 6:38 p.m. UTC
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

It is now possible to flag trip points with THERMAL_TRIP_FLAG_RW_TEMP
to allow their temperature to be set from user space via sysfs instead
of using a nonzero writable trips mask during thermal zone registration,
so make the iwlwifi code do that.

No intentional functional impact.

Note that this change is requisite for dropping the mask argument from
thermal_zone_device_register_with_trips() going forward.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

v1 -> v2:
   * Rename trip flag (Stanislaw).
   * Fix coding mistake in iwl_mvm_thermal_zone_register().
   * Add "wifi:" prefix to the subject (Kalle).

---
 drivers/net/wireless/intel/iwlwifi/mvm/tt.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Rafael J. Wysocki Feb. 15, 2024, 6:04 p.m. UTC | #1
On Mon, Feb 12, 2024 at 7:42 PM Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
>
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> It is now possible to flag trip points with THERMAL_TRIP_FLAG_RW_TEMP
> to allow their temperature to be set from user space via sysfs instead
> of using a nonzero writable trips mask during thermal zone registration,
> so make the iwlwifi code do that.
>
> No intentional functional impact.
>
> Note that this change is requisite for dropping the mask argument from
> thermal_zone_device_register_with_trips() going forward.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>
> v1 -> v2:
>    * Rename trip flag (Stanislaw).
>    * Fix coding mistake in iwl_mvm_thermal_zone_register().
>    * Add "wifi:" prefix to the subject (Kalle).

I think that all of the feedback on the v1 of this patch has been
addressed, so are there any more concerns regarding it?

If not, it would be nice to get an ACK for it, so it can be routed
through the PM tree.

> ---
>  drivers/net/wireless/intel/iwlwifi/mvm/tt.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> Index: linux-pm/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
> ===================================================================
> --- linux-pm.orig/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
> +++ linux-pm/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
> @@ -667,9 +667,6 @@ static  struct thermal_zone_device_ops t
>         .set_trip_temp = iwl_mvm_tzone_set_trip_temp,
>  };
>
> -/* make all trips writable */
> -#define IWL_WRITABLE_TRIPS_MSK (BIT(IWL_MAX_DTS_TRIPS) - 1)
> -
>  static void iwl_mvm_thermal_zone_register(struct iwl_mvm *mvm)
>  {
>         int i, ret;
> @@ -692,11 +689,12 @@ static void iwl_mvm_thermal_zone_registe
>         for (i = 0 ; i < IWL_MAX_DTS_TRIPS; i++) {
>                 mvm->tz_device.trips[i].temperature = THERMAL_TEMP_INVALID;
>                 mvm->tz_device.trips[i].type = THERMAL_TRIP_PASSIVE;
> +               mvm->tz_device.trips[i].flags = THERMAL_TRIP_FLAG_RW_TEMP;
>         }
>         mvm->tz_device.tzone = thermal_zone_device_register_with_trips(name,
>                                                         mvm->tz_device.trips,
>                                                         IWL_MAX_DTS_TRIPS,
> -                                                       IWL_WRITABLE_TRIPS_MSK,
> +                                                       0,
>                                                         mvm, &tzone_ops,
>                                                         NULL, 0, 0);
>         if (IS_ERR(mvm->tz_device.tzone)) {
>
>
>
>
Daniel Lezcano Feb. 22, 2024, 3:14 p.m. UTC | #2
On 12/02/2024 19:38, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> It is now possible to flag trip points with THERMAL_TRIP_FLAG_RW_TEMP
> to allow their temperature to be set from user space via sysfs instead
> of using a nonzero writable trips mask during thermal zone registration,
> so make the iwlwifi code do that.
> 
> No intentional functional impact.
> 
> Note that this change is requisite for dropping the mask argument from
> thermal_zone_device_register_with_trips() going forward.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---

Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
diff mbox series

Patch

Index: linux-pm/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
===================================================================
--- linux-pm.orig/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
+++ linux-pm/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
@@ -667,9 +667,6 @@  static  struct thermal_zone_device_ops t
 	.set_trip_temp = iwl_mvm_tzone_set_trip_temp,
 };
 
-/* make all trips writable */
-#define IWL_WRITABLE_TRIPS_MSK (BIT(IWL_MAX_DTS_TRIPS) - 1)
-
 static void iwl_mvm_thermal_zone_register(struct iwl_mvm *mvm)
 {
 	int i, ret;
@@ -692,11 +689,12 @@  static void iwl_mvm_thermal_zone_registe
 	for (i = 0 ; i < IWL_MAX_DTS_TRIPS; i++) {
 		mvm->tz_device.trips[i].temperature = THERMAL_TEMP_INVALID;
 		mvm->tz_device.trips[i].type = THERMAL_TRIP_PASSIVE;
+		mvm->tz_device.trips[i].flags = THERMAL_TRIP_FLAG_RW_TEMP;
 	}
 	mvm->tz_device.tzone = thermal_zone_device_register_with_trips(name,
 							mvm->tz_device.trips,
 							IWL_MAX_DTS_TRIPS,
-							IWL_WRITABLE_TRIPS_MSK,
+							0,
 							mvm, &tzone_ops,
 							NULL, 0, 0);
 	if (IS_ERR(mvm->tz_device.tzone)) {