diff mbox series

[v3,1/2] thermal/core: Make the userspace governor deprecated

Message ID 20211019163506.2831454-1-daniel.lezcano@linaro.org (mailing list archive)
State New, archived
Delegated to: Daniel Lezcano
Headers show
Series [v3,1/2] thermal/core: Make the userspace governor deprecated | expand

Commit Message

Daniel Lezcano Oct. 19, 2021, 4:35 p.m. UTC
The userspace governor is sending temperature when polling is active
and trip point crossed events. Nothing else.

AFAICT, this governor is used with custom kernels making the userspace
governor co-existing with another governor on the same thermal zone
because there was no notification mechanism, implying a hack in the
framework to support this configuration.

The new netlink thermal notification is able to provide more
information than the userspace governor and give the opportunity to
the users of this governor to replace it by a dedicated notification
framework.

The userspace governor will be removed as its usage is no longer
needed.

Add a warning message to tell the userspace governor is deprecated.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/thermal/gov_user_space.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Daniel Lezcano Oct. 20, 2021, 10:47 a.m. UTC | #1
Hi Lukasz,

Do you agree with these changes ?

On 19/10/2021 18:35, Daniel Lezcano wrote:
> The userspace governor is sending temperature when polling is active
> and trip point crossed events. Nothing else.
> 
> AFAICT, this governor is used with custom kernels making the userspace
> governor co-existing with another governor on the same thermal zone
> because there was no notification mechanism, implying a hack in the
> framework to support this configuration.
> 
> The new netlink thermal notification is able to provide more
> information than the userspace governor and give the opportunity to
> the users of this governor to replace it by a dedicated notification
> framework.
> 
> The userspace governor will be removed as its usage is no longer
> needed.
> 
> Add a warning message to tell the userspace governor is deprecated.
> 
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  drivers/thermal/gov_user_space.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/thermal/gov_user_space.c b/drivers/thermal/gov_user_space.c
> index 82a7198bbe71..f4fe050e1cbc 100644
> --- a/drivers/thermal/gov_user_space.c
> +++ b/drivers/thermal/gov_user_space.c
> @@ -15,6 +15,14 @@
>  
>  #include "thermal_core.h"
>  
> +static int user_space_bind(struct thermal_zone_device *tz)
> +{
> +	pr_warn("Userspace governor deprecated: use thermal netlink "	\
> +		"notification instead\n");
> +
> +	return 0;
> +}
> +
>  /**
>   * notify_user_space - Notifies user space about thermal events
>   * @tz: thermal_zone_device
> @@ -43,5 +51,6 @@ static int notify_user_space(struct thermal_zone_device *tz, int trip)
>  static struct thermal_governor thermal_gov_user_space = {
>  	.name		= "user_space",
>  	.throttle	= notify_user_space,
> +	.bind_to_tz	= user_space_bind,
>  };
>  THERMAL_GOVERNOR_DECLARE(thermal_gov_user_space);
>
Lukasz Luba Oct. 21, 2021, 3:30 p.m. UTC | #2
Hi Daniel,


On 10/20/21 11:47 AM, Daniel Lezcano wrote:
> 
> Hi Lukasz,
> 
> Do you agree with these changes ?

Yes, I agree with these changes.

> 
> On 19/10/2021 18:35, Daniel Lezcano wrote:
>> The userspace governor is sending temperature when polling is active
>> and trip point crossed events. Nothing else.
>>
>> AFAICT, this governor is used with custom kernels making the userspace
>> governor co-existing with another governor on the same thermal zone
>> because there was no notification mechanism, implying a hack in the
>> framework to support this configuration.
>>
>> The new netlink thermal notification is able to provide more
>> information than the userspace governor and give the opportunity to
>> the users of this governor to replace it by a dedicated notification
>> framework.
>>
>> The userspace governor will be removed as its usage is no longer
>> needed.
>>
>> Add a warning message to tell the userspace governor is deprecated.
>>
>> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>> ---
>>   drivers/thermal/gov_user_space.c | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/thermal/gov_user_space.c b/drivers/thermal/gov_user_space.c
>> index 82a7198bbe71..f4fe050e1cbc 100644
>> --- a/drivers/thermal/gov_user_space.c
>> +++ b/drivers/thermal/gov_user_space.c
>> @@ -15,6 +15,14 @@
>>   
>>   #include "thermal_core.h"
>>   
>> +static int user_space_bind(struct thermal_zone_device *tz)
>> +{
>> +	pr_warn("Userspace governor deprecated: use thermal netlink "	\
>> +		"notification instead\n");
>> +
>> +	return 0;
>> +}
>> +
>>   /**
>>    * notify_user_space - Notifies user space about thermal events
>>    * @tz: thermal_zone_device
>> @@ -43,5 +51,6 @@ static int notify_user_space(struct thermal_zone_device *tz, int trip)
>>   static struct thermal_governor thermal_gov_user_space = {
>>   	.name		= "user_space",
>>   	.throttle	= notify_user_space,
>> +	.bind_to_tz	= user_space_bind,
>>   };
>>   THERMAL_GOVERNOR_DECLARE(thermal_gov_user_space);
>>
> 
> 


You can add:

Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>

Regards,
Lukasz
Daniel Lezcano Oct. 21, 2021, 3:35 p.m. UTC | #3
On 21/10/2021 17:30, Lukasz Luba wrote:


[ ... ]

>>
> 
> 
> You can add:
> 
> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
> 

Thanks Lukasz
diff mbox series

Patch

diff --git a/drivers/thermal/gov_user_space.c b/drivers/thermal/gov_user_space.c
index 82a7198bbe71..f4fe050e1cbc 100644
--- a/drivers/thermal/gov_user_space.c
+++ b/drivers/thermal/gov_user_space.c
@@ -15,6 +15,14 @@ 
 
 #include "thermal_core.h"
 
+static int user_space_bind(struct thermal_zone_device *tz)
+{
+	pr_warn("Userspace governor deprecated: use thermal netlink "	\
+		"notification instead\n");
+
+	return 0;
+}
+
 /**
  * notify_user_space - Notifies user space about thermal events
  * @tz: thermal_zone_device
@@ -43,5 +51,6 @@  static int notify_user_space(struct thermal_zone_device *tz, int trip)
 static struct thermal_governor thermal_gov_user_space = {
 	.name		= "user_space",
 	.throttle	= notify_user_space,
+	.bind_to_tz	= user_space_bind,
 };
 THERMAL_GOVERNOR_DECLARE(thermal_gov_user_space);