diff mbox series

[1/6] iwlwifi: use thermal_zone_device_update() for temperature change

Message ID 20200430063229.6182-2-rui.zhang@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: Zhang Rui
Headers show
Series thermal: improve handling of disabled thermal zone | expand

Commit Message

Zhang, Rui April 30, 2020, 6:32 a.m. UTC
thermal_notify_framework() is an obsolete API, and iwlwifi is the only
user of it.
Convert iwlwifi driver to use thermal_zone_device_update() instead.

Note that, thermal_zone_device_update() is able to handle the crossed
threshold by comparing the current temperature with every trip point, so
ths_crossed variant in iwl_mvm_temp_notif() is probably not needed.
It is still left there in this patch, in case the debug information is
still needed.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Zhang, Rui May 12, 2020, 1:58 a.m. UTC | #1
On Thu, 2020-04-30 at 14:32 +0800, Zhang Rui wrote:
> thermal_notify_framework() is an obsolete API, and iwlwifi is the
> only
> user of it.
> Convert iwlwifi driver to use thermal_zone_device_update() instead.
> 
> Note that, thermal_zone_device_update() is able to handle the crossed
> threshold by comparing the current temperature with every trip point,
> so
> ths_crossed variant in iwl_mvm_temp_notif() is probably not needed.
> It is still left there in this patch, in case the debug information
> is
> still needed.
> 
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Hi, Luca,

Any comments about this patch and patch 6/6?

thanks,
rui

> ---
>  drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
> b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
> index 418e59b..6344b6b 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
> @@ -203,9 +203,8 @@ void iwl_mvm_temp_notif(struct iwl_mvm *mvm,
> struct iwl_rx_cmd_buffer *rxb)
>  
>  	if (mvm->tz_device.tzone) {
>  		struct iwl_mvm_thermal_device *tz_dev = &mvm-
> >tz_device;
> -
> -		thermal_notify_framework(tz_dev->tzone,
> -					 tz_dev-
> >fw_trips_index[ths_crossed]);
> +		thermal_zone_device_update(tz_dev->tzone,
> +					   THERMAL_EVENT_UNSPECIFIED);
>  	}
>  #endif /* CONFIG_THERMAL */
>  }
Luca Coelho May 18, 2020, 11:21 a.m. UTC | #2
On Tue, 2020-05-12 at 09:58 +0800, Zhang Rui wrote:
> On Thu, 2020-04-30 at 14:32 +0800, Zhang Rui wrote:
> > thermal_notify_framework() is an obsolete API, and iwlwifi is the
> > only
> > user of it.
> > Convert iwlwifi driver to use thermal_zone_device_update() instead.
> > 
> > Note that, thermal_zone_device_update() is able to handle the crossed
> > threshold by comparing the current temperature with every trip point,
> > so
> > ths_crossed variant in iwl_mvm_temp_notif() is probably not needed.
> > It is still left there in this patch, in case the debug information
> > is
> > still needed.
> > 
> > Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> 
> Hi, Luca,
> 
> Any comments about this patch and patch 6/6?

Hi Rui,

Sorry for the delay, we have been making some small changes in this
code to support a new interface with our firmware and I wanted to make
sure things work together.

I'm adding Gil, who is making the changes, to this thread so he can
also take a look.

--
Cheers,
Luca.
Zhang, Rui May 25, 2020, 6:04 a.m. UTC | #3
On Mon, 2020-05-18 at 14:21 +0300, Luca Coelho wrote:
> On Tue, 2020-05-12 at 09:58 +0800, Zhang Rui wrote:
> > On Thu, 2020-04-30 at 14:32 +0800, Zhang Rui wrote:
> > > thermal_notify_framework() is an obsolete API, and iwlwifi is the
> > > only
> > > user of it.
> > > Convert iwlwifi driver to use thermal_zone_device_update()
> > > instead.
> > > 
> > > Note that, thermal_zone_device_update() is able to handle the
> > > crossed
> > > threshold by comparing the current temperature with every trip
> > > point,
> > > so
> > > ths_crossed variant in iwl_mvm_temp_notif() is probably not
> > > needed.
> > > It is still left there in this patch, in case the debug
> > > information
> > > is
> > > still needed.
> > > 
> > > Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> > 
> > Hi, Luca,
> > 
> > Any comments about this patch and patch 6/6?
> 
> Hi Rui,
> 
> Sorry for the delay, we have been making some small changes in this
> code to support a new interface with our firmware and I wanted to
> make
> sure things work together.
> 
> I'm adding Gil, who is making the changes, to this thread so he can
> also take a look.

thanks, Luca.

Gil,
can you please take a look at this patches series?

thanks,
rui
> 
> --
> Cheers,
> Luca.
>
Rafael J. Wysocki May 25, 2020, 1:33 p.m. UTC | #4
On Thu, Apr 30, 2020 at 8:29 AM Zhang Rui <rui.zhang@intel.com> wrote:
>
> thermal_notify_framework() is an obsolete API, and iwlwifi is the only
> user of it.
> Convert iwlwifi driver to use thermal_zone_device_update() instead.

IMO it is rather hard to figure out what is going to change
functionally, from the driver's perspective, after this change.

In particular, is user space going to notice any change?  If so, then
what kind of change can it see?

> Note that, thermal_zone_device_update() is able to handle the crossed
> threshold by comparing the current temperature with every trip point, so
> ths_crossed variant in iwl_mvm_temp_notif() is probably not needed.
>
> It is still left there in this patch, in case the debug information is
> still needed.

Well, it should be possible to figure this out just from the code ...

> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
> index 418e59b..6344b6b 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
> @@ -203,9 +203,8 @@ void iwl_mvm_temp_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
>
>         if (mvm->tz_device.tzone) {
>                 struct iwl_mvm_thermal_device *tz_dev = &mvm->tz_device;
> -
> -               thermal_notify_framework(tz_dev->tzone,
> -                                        tz_dev->fw_trips_index[ths_crossed]);
> +               thermal_zone_device_update(tz_dev->tzone,
> +                                          THERMAL_EVENT_UNSPECIFIED);
>         }
>  #endif /* CONFIG_THERMAL */
>  }
> --
> 2.7.4
>
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
index 418e59b..6344b6b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
@@ -203,9 +203,8 @@  void iwl_mvm_temp_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
 
 	if (mvm->tz_device.tzone) {
 		struct iwl_mvm_thermal_device *tz_dev = &mvm->tz_device;
-
-		thermal_notify_framework(tz_dev->tzone,
-					 tz_dev->fw_trips_index[ths_crossed]);
+		thermal_zone_device_update(tz_dev->tzone,
+					   THERMAL_EVENT_UNSPECIFIED);
 	}
 #endif /* CONFIG_THERMAL */
 }