2024-04-10 17:45:39

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH v1 15/16] thermal: core: Drop the .throttle() governor callback

From: Rafael J. Wysocki <[email protected]>

Since all of the governors in the tree have been switched over to using
the new callbacks, either .trip_crossed() or .manage(), the .throttle()
governor callback is not used any more, so drop it.

Signed-off-by: Rafael J. Wysocki <[email protected]>
---
drivers/thermal/thermal_core.c | 11 -----------
drivers/thermal/thermal_core.h | 4 ----
2 files changed, 15 deletions(-)

Index: linux-pm/drivers/thermal/thermal_core.c
===================================================================
--- linux-pm.orig/drivers/thermal/thermal_core.c
+++ linux-pm/drivers/thermal/thermal_core.c
@@ -310,15 +310,6 @@ static struct thermal_governor *thermal_
return def_governor;
}

-static void handle_non_critical_trips(struct thermal_zone_device *tz,
- const struct thermal_trip *trip)
-{
- struct thermal_governor *governor = thermal_get_tz_governor(tz);
-
- if (governor->throttle)
- governor->throttle(tz, trip);
-}
-
void thermal_governor_update_tz(struct thermal_zone_device *tz,
enum thermal_notify_event reason)
{
@@ -418,8 +409,6 @@ static void handle_thermal_trip(struct t

if (trip->type == THERMAL_TRIP_CRITICAL || trip->type == THERMAL_TRIP_HOT)
handle_critical_trips(tz, trip);
- else
- handle_non_critical_trips(tz, trip);
}

static void update_temperature(struct thermal_zone_device *tz)
Index: linux-pm/drivers/thermal/thermal_core.h
===================================================================
--- linux-pm.orig/drivers/thermal/thermal_core.h
+++ linux-pm/drivers/thermal/thermal_core.h
@@ -32,8 +32,6 @@ struct thermal_trip_desc {
* thermal zone.
* @trip_crossed: called for trip points that have just been crossed
* @manage: called on thermal zone temperature updates
- * @throttle: callback called for every trip point even if temperature is
- * below the trip point temperature
* @update_tz: callback called when thermal zone internals have changed, e.g.
* thermal cooling instance was added/removed
* @governor_list: node in thermal_governor_list (in thermal_core.c)
@@ -46,8 +44,6 @@ struct thermal_governor {
const struct thermal_trip *trip,
bool crossed_up);
void (*manage)(struct thermal_zone_device *tz);
- int (*throttle)(struct thermal_zone_device *tz,
- const struct thermal_trip *trip);
void (*update_tz)(struct thermal_zone_device *tz,
enum thermal_notify_event reason);
struct list_head governor_list;





2024-04-19 18:50:12

by Lukasz Luba

[permalink] [raw]
Subject: Re: [PATCH v1 15/16] thermal: core: Drop the .throttle() governor callback



On 4/10/24 18:42, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <[email protected]>
>
> Since all of the governors in the tree have been switched over to using
> the new callbacks, either .trip_crossed() or .manage(), the .throttle()
> governor callback is not used any more, so drop it.
>
> Signed-off-by: Rafael J. Wysocki <[email protected]>
> ---
> drivers/thermal/thermal_core.c | 11 -----------
> drivers/thermal/thermal_core.h | 4 ----
> 2 files changed, 15 deletions(-)
>
> Index: linux-pm/drivers/thermal/thermal_core.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/thermal_core.c
> +++ linux-pm/drivers/thermal/thermal_core.c
> @@ -310,15 +310,6 @@ static struct thermal_governor *thermal_
> return def_governor;
> }
>
> -static void handle_non_critical_trips(struct thermal_zone_device *tz,
> - const struct thermal_trip *trip)
> -{
> - struct thermal_governor *governor = thermal_get_tz_governor(tz);
> -
> - if (governor->throttle)
> - governor->throttle(tz, trip);
> -}
> -
> void thermal_governor_update_tz(struct thermal_zone_device *tz,
> enum thermal_notify_event reason)
> {
> @@ -418,8 +409,6 @@ static void handle_thermal_trip(struct t
>
> if (trip->type == THERMAL_TRIP_CRITICAL || trip->type == THERMAL_TRIP_HOT)
> handle_critical_trips(tz, trip);
> - else
> - handle_non_critical_trips(tz, trip);
> }
>
> static void update_temperature(struct thermal_zone_device *tz)
> Index: linux-pm/drivers/thermal/thermal_core.h
> ===================================================================
> --- linux-pm.orig/drivers/thermal/thermal_core.h
> +++ linux-pm/drivers/thermal/thermal_core.h
> @@ -32,8 +32,6 @@ struct thermal_trip_desc {
> * thermal zone.
> * @trip_crossed: called for trip points that have just been crossed
> * @manage: called on thermal zone temperature updates
> - * @throttle: callback called for every trip point even if temperature is
> - * below the trip point temperature
> * @update_tz: callback called when thermal zone internals have changed, e.g.
> * thermal cooling instance was added/removed
> * @governor_list: node in thermal_governor_list (in thermal_core.c)
> @@ -46,8 +44,6 @@ struct thermal_governor {
> const struct thermal_trip *trip,
> bool crossed_up);
> void (*manage)(struct thermal_zone_device *tz);
> - int (*throttle)(struct thermal_zone_device *tz,
> - const struct thermal_trip *trip);
> void (*update_tz)(struct thermal_zone_device *tz,
> enum thermal_notify_event reason);
> struct list_head governor_list;
>
>
>



Reviewed-by: Lukasz Luba <[email protected]>

2024-04-24 09:27:26

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH v1 15/16] thermal: core: Drop the .throttle() governor callback

On Wed, Apr 10, 2024 at 07:42:35PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <[email protected]>
>
> Since all of the governors in the tree have been switched over to using
> the new callbacks, either .trip_crossed() or .manage(), the .throttle()
> governor callback is not used any more, so drop it.
>
> Signed-off-by: Rafael J. Wysocki <[email protected]>
> ---

Acked-by: Daniel Lezcano <[email protected]>