diff mbox series

[SRU,M:raspi] Fix hysteresis support in gov_step_wise.c (#5736)

Message ID 20231124184809.111143-1-juerg.haefliger@canonical.com
State New
Headers show
Series [SRU,M:raspi] Fix hysteresis support in gov_step_wise.c (#5736) | expand

Commit Message

Juerg Haefliger Nov. 24, 2023, 6:48 p.m. UTC
From: Jürgen Kreileder <jk@blackdown.de>

BugLink: https://bugs.launchpad.net/bugs/2044341

Fix hysteresis support in gov_step_wise.c

Directly get hyst value instead of going through an
optional and, now, unimplemented function.

Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
(cherry picked from commit d3668f4e7e2747f38d7f680df231f02dd33d3a13 rpi-6.5.y)
Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
---
 drivers/thermal/gov_step_wise.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Agathe Porte Nov. 27, 2023, 10:14 a.m. UTC | #1
2023-11-24 19:49 CET, Juerg Haefliger:
> From: Jürgen Kreileder <jk@blackdown.de>
> 
> BugLink: https://bugs.launchpad.net/bugs/2044341
> 
> Fix hysteresis support in gov_step_wise.c
> 
> Directly get hyst value instead of going through an
> optional and, now, unimplemented function.
> 
> Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
> (cherry picked from commit d3668f4e7e2747f38d7f680df231f02dd33d3a13 rpi-6.5.y)
> Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
> ---
>  drivers/thermal/gov_step_wise.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/thermal/gov_step_wise.c b/drivers/thermal/gov_step_wise.c
> index eefeb6407d0f..8b83fbb933db 100644
> --- a/drivers/thermal/gov_step_wise.c
> +++ b/drivers/thermal/gov_step_wise.c
> @@ -98,11 +98,8 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip_id
>  		trace_thermal_zone_trip(tz, trip_id, trip.type);
>  	}
>  
> -	hyst_temp = trip_temp = trip.temperature;
> -	if (tz->ops->get_trip_hyst) {
> -		tz->ops->get_trip_hyst(tz, trip_id, &hyst_temp);
> -		hyst_temp = trip_temp - hyst_temp;
> -	}
> +	trip_temp = trip.temperature;
> +	hyst_temp = trip_temp - trip.hysteresis;
>  	trip_type = trip.type;
>  
>  	dev_dbg(&tz->device,

Acked-by: Agathe Porte <agathe.porte@canonical.com>
Jose Ogando Nov. 27, 2023, 10:54 a.m. UTC | #2
LGTM

Acked-by: Jose Ogando <jose.ogando@canonical.com>

On Fri, 2023-11-24 at 19:48 +0100, Juerg Haefliger wrote:
> From: Jürgen Kreileder <jk@blackdown.de>
> 
> BugLink: https://bugs.launchpad.net/bugs/2044341
> 
> Fix hysteresis support in gov_step_wise.c
> 
> Directly get hyst value instead of going through an
> optional and, now, unimplemented function.
> 
> Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
> (cherry picked from commit d3668f4e7e2747f38d7f680df231f02dd33d3a13
> rpi-6.5.y)
> Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
> ---
>  drivers/thermal/gov_step_wise.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/thermal/gov_step_wise.c
> b/drivers/thermal/gov_step_wise.c
> index eefeb6407d0f..8b83fbb933db 100644
> --- a/drivers/thermal/gov_step_wise.c
> +++ b/drivers/thermal/gov_step_wise.c
> @@ -98,11 +98,8 @@ static void thermal_zone_trip_update(struct
> thermal_zone_device *tz, int trip_id
>                 trace_thermal_zone_trip(tz, trip_id, trip.type);
>         }
>  
> -       hyst_temp = trip_temp = trip.temperature;
> -       if (tz->ops->get_trip_hyst) {
> -               tz->ops->get_trip_hyst(tz, trip_id, &hyst_temp);
> -               hyst_temp = trip_temp - hyst_temp;
> -       }
> +       trip_temp = trip.temperature;
> +       hyst_temp = trip_temp - trip.hysteresis;
>         trip_type = trip.type;
>  
>         dev_dbg(&tz->device,
> -- 
> 2.40.1
> 
>
Juerg Haefliger Nov. 28, 2023, 10:40 a.m. UTC | #3
Applied to mantic:linux-raspi master-next branch.

...Juerg


> From: Jürgen Kreileder <jk@blackdown.de>
> 
> BugLink: https://bugs.launchpad.net/bugs/2044341
> 
> Fix hysteresis support in gov_step_wise.c
> 
> Directly get hyst value instead of going through an
> optional and, now, unimplemented function.
> 
> Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
> (cherry picked from commit d3668f4e7e2747f38d7f680df231f02dd33d3a13 rpi-6.5.y)
> Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
> ---
>  drivers/thermal/gov_step_wise.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/thermal/gov_step_wise.c b/drivers/thermal/gov_step_wise.c
> index eefeb6407d0f..8b83fbb933db 100644
> --- a/drivers/thermal/gov_step_wise.c
> +++ b/drivers/thermal/gov_step_wise.c
> @@ -98,11 +98,8 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip_id
>  		trace_thermal_zone_trip(tz, trip_id, trip.type);
>  	}
>  
> -	hyst_temp = trip_temp = trip.temperature;
> -	if (tz->ops->get_trip_hyst) {
> -		tz->ops->get_trip_hyst(tz, trip_id, &hyst_temp);
> -		hyst_temp = trip_temp - hyst_temp;
> -	}
> +	trip_temp = trip.temperature;
> +	hyst_temp = trip_temp - trip.hysteresis;
>  	trip_type = trip.type;
>  
>  	dev_dbg(&tz->device,
diff mbox series

Patch

diff --git a/drivers/thermal/gov_step_wise.c b/drivers/thermal/gov_step_wise.c
index eefeb6407d0f..8b83fbb933db 100644
--- a/drivers/thermal/gov_step_wise.c
+++ b/drivers/thermal/gov_step_wise.c
@@ -98,11 +98,8 @@  static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip_id
 		trace_thermal_zone_trip(tz, trip_id, trip.type);
 	}
 
-	hyst_temp = trip_temp = trip.temperature;
-	if (tz->ops->get_trip_hyst) {
-		tz->ops->get_trip_hyst(tz, trip_id, &hyst_temp);
-		hyst_temp = trip_temp - hyst_temp;
-	}
+	trip_temp = trip.temperature;
+	hyst_temp = trip_temp - trip.hysteresis;
 	trip_type = trip.type;
 
 	dev_dbg(&tz->device,