# \[PATCH 0/2\] thermal: Replace thermal\_notify\_framework with thermal\_zone\_device\_update

- Subsystems: INTEL WIRELESS WIFI LINK (iwlwifi), THE REST, THERMAL
- Maintainers: Miri Korenblit, Linus Torvalds, Rafael J. Wysocki, Daniel Lezcano
- Series: 2 patches touching 3 files, +2/-24
- Status: SUPERSEDED (Superseded by v2 posted 2021-01-22)
- Superseded by v2 (posted 2021-01-22).
- Revision v1 (2 revisions archived).
- List: netdev
- 5 messages, 2 authors
- Page: https://ratatoskr.run/netdev/2021/01/6240452/t

## \[PATCH 0/2\] thermal: Replace thermal\_notify\_framework with thermal\_zone\_device\_update

- From: Thara Gopinath \<hidden\>
- Date: 2021-01-19 23:39:57 
- Message: https://ratatoskr.run/netdev/2021/01/6240452.md

```text
thermal_notify_framework just updates for a single trip point where as
thermal_zone_device_update does other bookkeeping like updating the
temperature of the thermal zone, running through the list of trip points
and setting the next trip point etc. Since  the later is a more thorough
version of former, replace thermal_notify_framework with
thermal_zone_device_update. 

Thara Gopinath (2):
  net: wireless: intel: iwlwifi: mvm: tt: Replace
    thermal_notify_framework
  drivers: thermal: Remove thermal_notify_framework

 drivers/net/wireless/intel/iwlwifi/mvm/tt.c |  4 ++--
 drivers/thermal/thermal_core.c              | 18 ------------------
 include/linux/thermal.h                     |  4 ----
 3 files changed, 2 insertions(+), 24 deletions(-)

-- 
2.25.1

```

## \[PATCH 2/2\] drivers: thermal: Remove thermal\_notify\_framework

- From: Thara Gopinath \<hidden\>
- Date: 2021-01-19 23:42:28 
- Message: https://ratatoskr.run/netdev/2021/01/6240456.md

```text
thermal_notify_framework just updates for a single trip point where as
thermal_zone_device_update does other bookkeeping like updating the
temperature of the thermal zone and setting the next trip point. The only
driver that was using thermal_notify_framework was updated in the previous
patch to use thermal_zone_device_update instead. Since there are no users
for thermal_notify_framework remove it.

Signed-off-by: Thara Gopinath <redacted>
---
 drivers/thermal/thermal_core.c | 18 ------------------
 include/linux/thermal.h        |  4 ----
 2 files changed, 22 deletions(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 4a291d205d5c..04f7581b70c5 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -575,24 +575,6 @@ void thermal_zone_device_update(struct thermal_zone_device *tz,
 }
 EXPORT_SYMBOL_GPL(thermal_zone_device_update);
 
-/**
- * thermal_notify_framework - Sensor drivers use this API to notify framework
- * @tz:		thermal zone device
- * @trip:	indicates which trip point has been crossed
- *
- * This function handles the trip events from sensor drivers. It starts
- * throttling the cooling devices according to the policy configured.
- * For CRITICAL and HOT trip points, this notifies the respective drivers,
- * and does actual throttling for other trip points i.e ACTIVE and PASSIVE.
- * The throttling policy is based on the configured platform data; if no
- * platform data is provided, this uses the step_wise throttling policy.
- */
-void thermal_notify_framework(struct thermal_zone_device *tz, int trip)
-{
-	handle_thermal_trip(tz, trip);
-}
-EXPORT_SYMBOL_GPL(thermal_notify_framework);
-
 static void thermal_zone_device_check(struct work_struct *work)
 {
 	struct thermal_zone_device *tz = container_of(work, struct
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 31b84404f047..77a0b8d060a5 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -398,7 +398,6 @@ int thermal_zone_get_slope(struct thermal_zone_device *tz);
 int thermal_zone_get_offset(struct thermal_zone_device *tz);
 
 void thermal_cdev_update(struct thermal_cooling_device *);
-void thermal_notify_framework(struct thermal_zone_device *, int);
 int thermal_zone_device_enable(struct thermal_zone_device *tz);
 int thermal_zone_device_disable(struct thermal_zone_device *tz);
 void thermal_zone_device_critical(struct thermal_zone_device *tz);
@@ -446,9 +445,6 @@ static inline int thermal_zone_get_offset(
 
 static inline void thermal_cdev_update(struct thermal_cooling_device *cdev)
 { }
-static inline void thermal_notify_framework(struct thermal_zone_device *tz,
-	int trip)
-{ }
 
 static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)
 { return -ENODEV; }
-- 
2.25.1

```

## \[PATCH 1/2\] net: wireless: intel: iwlwifi: mvm: tt: Replace thermal\_notify\_framework

- From: Thara Gopinath \<hidden\>
- Date: 2021-01-19 23:44:27 
- Message: https://ratatoskr.run/netdev/2021/01/6240461.md

```text
thermal_notify_framework just updates for a single trip point where as
thermal_zone_device_update does other bookkeeping like updating the
temperature of the thermal zone and setting the next trip point etc.
Replace thermal_notify_framework with thermal_zone_device_update as the
later is more thorough.

Signed-off-by: Thara Gopinath <redacted>
---
 drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
index 507625f96dd7..a0c6be03903a 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
@@ -146,8 +146,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_TRIP_VIOLATED);
 	}
 #endif /* CONFIG_THERMAL */
 }
-- 
2.25.1

```

## RE: \[PATCH 0/2\] thermal: Replace thermal\_notify\_framework with thermal\_zone\_device\_update

- From: Zhang, Rui \<rui.zhang@intel.com\>
- Date: 2021-01-20 03:14:49 
- Message: https://ratatoskr.run/netdev/2021/01/6240703.md

```text
Hi, Thara,

Thanks for the cleanup. I've proposed similar patches previously.
https://patchwork.kernel.org/project/linux-pm/patch/20200430063229.6182-2-rui.zhang@intel.com/
https://patchwork.kernel.org/project/linux-pm/patch/20200430063229.6182-3-rui.zhang@intel.com/
can you please also address the comments in the previous discussion, like doc cleanup?

Thanks,
rui

> -----Original Message-----
> From: Thara Gopinath <redacted>
> Sent: Tuesday, January 19, 2021 10:06 PM
> To: Zhang, Rui <rui.zhang@intel.com>; <redacted>;
> kvalo@codeaurora.org; davem@davemloft.net; kuba@kernel.org; Coelho,
> Luciano [ref]
> Cc: <redacted>; <redacted>;
> netdev@vger.kernel.org; linux-pm@vger.kernel.org; amitk@kernel.org;
> Errera, Nathan [ref]
> Subject: [PATCH 0/2] thermal: Replace thermal_notify_framework with
> thermal_zone_device_update
> Importance: High
> 
> thermal_notify_framework just updates for a single trip point where as
> thermal_zone_device_update does other bookkeeping like updating the
> temperature of the thermal zone, running through the list of trip points and
> setting the next trip point etc. Since  the later is a more thorough version of
> former, replace thermal_notify_framework with
> thermal_zone_device_update.
> 
> Thara Gopinath (2):
>   net: wireless: intel: iwlwifi: mvm: tt: Replace
>     thermal_notify_framework
>   drivers: thermal: Remove thermal_notify_framework
> 
>  drivers/net/wireless/intel/iwlwifi/mvm/tt.c |  4 ++--
>  drivers/thermal/thermal_core.c              | 18 ------------------
>  include/linux/thermal.h                     |  4 ----
>  3 files changed, 2 insertions(+), 24 deletions(-)
> 
> --
> 2.25.1

```

## Re: \[PATCH 0/2\] thermal: Replace thermal\_notify\_framework with thermal\_zone\_device\_update

- From: Thara Gopinath \<hidden\>
- Date: 2021-01-20 11:51:39 
- Message: https://ratatoskr.run/netdev/2021/01/6241077.md

```text


On 1/19/21 9:56 PM, Zhang, Rui wrote:
> Hi, Thara,
>
> Thanks for the cleanup. I've proposed similar patches previously.
> https://patchwork.kernel.org/project/linux-pm/patch/20200430063229.6182-2-rui.zhang@intel.com/
> https://patchwork.kernel.org/project/linux-pm/patch/20200430063229.6182-3-rui.zhang@intel.com/
> can you please also address the comments in the previous discussion, like doc cleanup?

Hi Rui,

Thanks for the quick feedback. I am sorry, I was not aware of your earlier series. I will add a patch cleaning up the Documentation and
send the v2. I have not tested this patch much. But I see from the
comments on your patches that this has been tested out. So that is good.

>
> Thanks,
> rui
>
>> -----Original Message-----
>> From: Thara Gopinath <redacted>
>> Sent: Tuesday, January 19, 2021 10:06 PM
>> To: Zhang, Rui <rui.zhang@intel.com>; <redacted>;
>> kvalo@codeaurora.org; davem@davemloft.net; kuba@kernel.org; Coelho,
>> Luciano [ref]
>> Cc: <redacted>; <redacted>;
>> netdev@vger.kernel.org; linux-pm@vger.kernel.org; amitk@kernel.org;
>> Errera, Nathan [ref]
>> Subject: [PATCH 0/2] thermal: Replace thermal_notify_framework with
>> thermal_zone_device_update
>> Importance: High
>>
>> thermal_notify_framework just updates for a single trip point where as
>> thermal_zone_device_update does other bookkeeping like updating the
>> temperature of the thermal zone, running through the list of trip points and
>> setting the next trip point etc. Since  the later is a more thorough version of
>> former, replace thermal_notify_framework with
>> thermal_zone_device_update.
>>
>> Thara Gopinath (2):
>>    net: wireless: intel: iwlwifi: mvm: tt: Replace
>>      thermal_notify_framework
>>    drivers: thermal: Remove thermal_notify_framework
>>
>>   drivers/net/wireless/intel/iwlwifi/mvm/tt.c |  4 ++--
>>   drivers/thermal/thermal_core.c              | 18 ------------------
>>   include/linux/thermal.h                     |  4 ----
>>   3 files changed, 2 insertions(+), 24 deletions(-)
>>
>> --
>> 2.25.1
>

-- 
Warm Regards
Thara
```
