diff options
author | Sultanxda <sultanxda@gmail.com> | 2017-07-16 19:46:59 -0700 |
---|---|---|
committer | Davide Garberi <dade.garberi@gmail.com> | 2022-07-27 19:23:20 +0200 |
commit | 4b1ec31cf9c4b9ba6feead04e347259391ebc294 (patch) | |
tree | 09c62b17c1f266b3446eb68f749912703ae406ef /drivers/cpufreq/qcom-cpufreq.c | |
parent | 919dc57be9bc1fb482a1edba41d4ea6b7f15f5b1 (diff) |
qcom-cpufreq: Use CLKFLAG_NO_RATE_CACHE
After a CPU comes online, clk_set_rate() silently refuses to change said CPU's
frequency to the frequency it was running at before going offline (since it
thinks that we are setting the same frequency redundantly). By default, each CPU
runs at its minimum frequency when coming online, so if the governor decides to
keep a CPU running at the frequency it used before going offline, then
clk_set_rate() will ignore the frequency change request and the CPU will stay
stuck running at its minimum frequency for a potentially long period of time
(i.e. until the governor decides to change the frequency to something
different). This can cause severe lag when a device is woken up from deep sleep.
In order to prevent a CPU from being stuck at its default frequency for a
potentially long period of time, set the CLKFLAG_NO_RATE_CACHE flag so that the
governor's frequency change requests will always be honored right after a CPU
comes online.
Note that this requires a CPU's component clocks to be using CLKFLAG_NO_RATE_CACHE
as well in order to fix the issue.
Signed-off-by: Sultanxda <sultanxda@gmail.com>
Diffstat (limited to 'drivers/cpufreq/qcom-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/qcom-cpufreq.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/cpufreq/qcom-cpufreq.c b/drivers/cpufreq/qcom-cpufreq.c index cb7323886082..64d0359c6b2a 100644 --- a/drivers/cpufreq/qcom-cpufreq.c +++ b/drivers/cpufreq/qcom-cpufreq.c @@ -23,7 +23,7 @@ #include <linux/cpu.h> #include <linux/cpumask.h> #include <linux/suspend.h> -#include <linux/clk.h> +#include <linux/clk/msm-clk-provider.h> #include <linux/err.h> #include <linux/platform_device.h> #include <linux/of.h> @@ -394,6 +394,7 @@ static int __init msm_cpufreq_probe(struct platform_device *pdev) return PTR_ERR(c); else if (IS_ERR(c)) c = cpu_clk[cpu-1]; + c->flags |= CLKFLAG_NO_RATE_CACHE; cpu_clk[cpu] = c; } hotplug_ready = true; |