2024-04-03 18:14:54

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH v1 0/2] thermal: gov_step_wide: Two cleanups

Hi Everyone,

The patches in this series clean up the step-wise thermal governor
and are not expected to alter its functionality.

Please see the changelogs of the patches for details.

The patches should apply directly on top of 6.9-rc2.

Thanks!





2024-04-03 19:10:09

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH v1 2/2] thermal: gov_step_wise: Simplify checks related to passive trips

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

Make it more clear from the code flow that the passive polling status
updates only take place for passive trip points.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <[email protected]>
---
drivers/thermal/gov_step_wise.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

Index: linux-pm/drivers/thermal/gov_step_wise.c
===================================================================
--- linux-pm.orig/drivers/thermal/gov_step_wise.c
+++ linux-pm/drivers/thermal/gov_step_wise.c
@@ -92,15 +92,13 @@ static void thermal_zone_trip_update(str
if (instance->initialized && old_target == instance->target)
continue;

- if (old_target == THERMAL_NO_TARGET &&
- instance->target != THERMAL_NO_TARGET) {
- /* Activate a passive thermal instance */
- if (trip->type == THERMAL_TRIP_PASSIVE)
+ if (trip->type == THERMAL_TRIP_PASSIVE) {
+ /* If needed, update the status of passive polling. */
+ if (old_target == THERMAL_NO_TARGET &&
+ instance->target != THERMAL_NO_TARGET)
tz->passive++;
- } else if (old_target != THERMAL_NO_TARGET &&
- instance->target == THERMAL_NO_TARGET) {
- /* Deactivate a passive thermal instance */
- if (trip->type == THERMAL_TRIP_PASSIVE)
+ else if (old_target != THERMAL_NO_TARGET &&
+ instance->target == THERMAL_NO_TARGET)
tz->passive--;
}





2024-04-04 11:26:45

by Lukasz Luba

[permalink] [raw]
Subject: Re: [PATCH v1 2/2] thermal: gov_step_wise: Simplify checks related to passive trips



On 4/3/24 19:12, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <[email protected]>
>
> Make it more clear from the code flow that the passive polling status
> updates only take place for passive trip points.
>
> No intentional functional impact.
>
> Signed-off-by: Rafael J. Wysocki <[email protected]>
> ---
> drivers/thermal/gov_step_wise.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> Index: linux-pm/drivers/thermal/gov_step_wise.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/gov_step_wise.c
> +++ linux-pm/drivers/thermal/gov_step_wise.c
> @@ -92,15 +92,13 @@ static void thermal_zone_trip_update(str
> if (instance->initialized && old_target == instance->target)
> continue;
>
> - if (old_target == THERMAL_NO_TARGET &&
> - instance->target != THERMAL_NO_TARGET) {
> - /* Activate a passive thermal instance */
> - if (trip->type == THERMAL_TRIP_PASSIVE)
> + if (trip->type == THERMAL_TRIP_PASSIVE) {
> + /* If needed, update the status of passive polling. */
> + if (old_target == THERMAL_NO_TARGET &&
> + instance->target != THERMAL_NO_TARGET)
> tz->passive++;
> - } else if (old_target != THERMAL_NO_TARGET &&
> - instance->target == THERMAL_NO_TARGET) {
> - /* Deactivate a passive thermal instance */
> - if (trip->type == THERMAL_TRIP_PASSIVE)
> + else if (old_target != THERMAL_NO_TARGET &&
> + instance->target == THERMAL_NO_TARGET)
> tz->passive--;
> }
>
>
>
>

The patch looks good, although I got some warning while applying with
my b4 tool:
BADSIG: DKIM/rjwysocki.net

Anyway, it looks like false warning IMO.

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

2024-04-04 11:57:27

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH v1 2/2] thermal: gov_step_wise: Simplify checks related to passive trips

On Thu, Apr 4, 2024 at 1:26 PM Lukasz Luba <[email protected]> wrote:
>
>
>
> On 4/3/24 19:12, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <[email protected]>
> >
> > Make it more clear from the code flow that the passive polling status
> > updates only take place for passive trip points.
> >
> > No intentional functional impact.
> >
> > Signed-off-by: Rafael J. Wysocki <[email protected]>
> > ---
> > drivers/thermal/gov_step_wise.c | 14 ++++++--------
> > 1 file changed, 6 insertions(+), 8 deletions(-)
> >
> > Index: linux-pm/drivers/thermal/gov_step_wise.c
> > ===================================================================
> > --- linux-pm.orig/drivers/thermal/gov_step_wise.c
> > +++ linux-pm/drivers/thermal/gov_step_wise.c
> > @@ -92,15 +92,13 @@ static void thermal_zone_trip_update(str
> > if (instance->initialized && old_target == instance->target)
> > continue;
> >
> > - if (old_target == THERMAL_NO_TARGET &&
> > - instance->target != THERMAL_NO_TARGET) {
> > - /* Activate a passive thermal instance */
> > - if (trip->type == THERMAL_TRIP_PASSIVE)
> > + if (trip->type == THERMAL_TRIP_PASSIVE) {
> > + /* If needed, update the status of passive polling. */
> > + if (old_target == THERMAL_NO_TARGET &&
> > + instance->target != THERMAL_NO_TARGET)
> > tz->passive++;
> > - } else if (old_target != THERMAL_NO_TARGET &&
> > - instance->target == THERMAL_NO_TARGET) {
> > - /* Deactivate a passive thermal instance */
> > - if (trip->type == THERMAL_TRIP_PASSIVE)
> > + else if (old_target != THERMAL_NO_TARGET &&
> > + instance->target == THERMAL_NO_TARGET)
> > tz->passive--;
> > }
> >
> >
> >
> >
>
> The patch looks good, although I got some warning while applying with
> my b4 tool:
> BADSIG: DKIM/rjwysocki.net

It's likely because it was sent from an address in the rjwysocki.net
domain, but it is perfectly fine to send "somebody else's" patches if
a replacement From: header is given.

Looks like a b4 issue to me.

> Anyway, it looks like false warning IMO.
>
> Reviewed-by: Lukasz Luba <[email protected]>

Thank you!