Re: [PATCH] cpufreq: conservative: Fix incorrect frequency decrease due to stale target

From: Viresh Kumar

Date: Thu May 07 2026 - 05:40:12 EST


On 23-04-26, 15:12, zhenglifeng (A) wrote:
> Yes, I think you are right. The behaviors are not the same. I modified this
> just in order to keep it consistent with the case exceeding down_threshold.
> I'm not sure if this change of behavior is reasonable. Perhaps Rafael or
> Viresh could give us some advice.

> >> diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
> >> @@ -104,7 +104,7 @@ static unsigned int cs_dbs_update(struct cpufreq_policy *policy)
> >>           dbs_info->down_skip = 0;
> >>             /* if we are already at full speed then break out early */
> >> -        if (requested_freq == policy->max)
> >> +        if (dbs_info->requested_freq == policy->max)
> >>               goto out;

> >> -        if (requested_freq == policy->min)
> >> +        if (dbs_info->requested_freq == policy->min)

What about dropping these `if` blocks completely ? i.e. always call
__cpufreq_driver_target().

__cpufreq_driver_target() already have similar checks in place to optimize
unnecessary freq changes. We don't really need callers to do the same.

--
viresh