Skip to content

Commit faef080

Browse files
vireshkrafaeljw
authored andcommitted
PM / OPP: Update performance state when freq == old_freq
At boot up, CPUFreq core performs a sanity check to see if the system is running at a frequency defined in the frequency table of the CPU. If so, we try to find a valid frequency (lowest frequency greater than the currently programmed frequency) from the table and set it. When the call reaches dev_pm_opp_set_rate(), it calls _find_freq_ceil(opp_table, &old_freq) to find the previously configured OPP and this call also updates the old_freq. This eventually sets the old_freq == freq (new target requested by cpufreq core) and we skip updating the performance state in this case. Fix this by also updating the performance state when the old_freq == freq. Fixes: ca1b5d7 ("OPP: Configure all required OPPs") Cc: v5.0 <stable@vger.kernel.org> # v5.0 Reported-by: Niklas Cassel <niklas.cassel@linaro.org> Tested-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 55286a2 commit faef080

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/opp/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
760760
old_freq, freq);
761761

762762
/* Scaling up? Configure required OPPs before frequency */
763-
if (freq > old_freq) {
763+
if (freq >= old_freq) {
764764
ret = _set_required_opps(dev, opp_table, opp);
765765
if (ret)
766766
goto put_opp;

0 commit comments

Comments
 (0)