diff options
-rw-r--r-- | drivers/cpufreq/cpufreq-dt-platdev.c | 7 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/intel_pstate.c | 5 |
3 files changed, 11 insertions, 5 deletions
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c index 3646b143bbf5..0bb44d5b5df4 100644 --- a/drivers/cpufreq/cpufreq-dt-platdev.c +++ b/drivers/cpufreq/cpufreq-dt-platdev.c | |||
@@ -79,15 +79,16 @@ static const struct of_device_id machines[] __initconst = { | |||
79 | static int __init cpufreq_dt_platdev_init(void) | 79 | static int __init cpufreq_dt_platdev_init(void) |
80 | { | 80 | { |
81 | struct device_node *np = of_find_node_by_path("/"); | 81 | struct device_node *np = of_find_node_by_path("/"); |
82 | const struct of_device_id *match; | ||
82 | 83 | ||
83 | if (!np) | 84 | if (!np) |
84 | return -ENODEV; | 85 | return -ENODEV; |
85 | 86 | ||
86 | if (!of_match_node(machines, np)) | 87 | match = of_match_node(machines, np); |
88 | of_node_put(np); | ||
89 | if (!match) | ||
87 | return -ENODEV; | 90 | return -ENODEV; |
88 | 91 | ||
89 | of_node_put(of_root); | ||
90 | |||
91 | return PTR_ERR_OR_ZERO(platform_device_register_simple("cpufreq-dt", -1, | 92 | return PTR_ERR_OR_ZERO(platform_device_register_simple("cpufreq-dt", -1, |
92 | NULL, 0)); | 93 | NULL, 0)); |
93 | } | 94 | } |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 9009295f5134..5617c7087d77 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -2261,6 +2261,10 @@ int cpufreq_update_policy(unsigned int cpu) | |||
2261 | * -> ask driver for current freq and notify governors about a change | 2261 | * -> ask driver for current freq and notify governors about a change |
2262 | */ | 2262 | */ |
2263 | if (cpufreq_driver->get && !cpufreq_driver->setpolicy) { | 2263 | if (cpufreq_driver->get && !cpufreq_driver->setpolicy) { |
2264 | if (cpufreq_suspended) { | ||
2265 | ret = -EAGAIN; | ||
2266 | goto unlock; | ||
2267 | } | ||
2264 | new_policy.cur = cpufreq_update_current_freq(policy); | 2268 | new_policy.cur = cpufreq_update_current_freq(policy); |
2265 | if (WARN_ON(!new_policy.cur)) { | 2269 | if (WARN_ON(!new_policy.cur)) { |
2266 | ret = -EIO; | 2270 | ret = -EIO; |
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index fe9dc17ea873..1fa1a32928d7 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
@@ -1400,6 +1400,9 @@ static void intel_pstate_set_update_util_hook(unsigned int cpu_num) | |||
1400 | { | 1400 | { |
1401 | struct cpudata *cpu = all_cpu_data[cpu_num]; | 1401 | struct cpudata *cpu = all_cpu_data[cpu_num]; |
1402 | 1402 | ||
1403 | if (cpu->update_util_set) | ||
1404 | return; | ||
1405 | |||
1403 | /* Prevent intel_pstate_update_util() from using stale data. */ | 1406 | /* Prevent intel_pstate_update_util() from using stale data. */ |
1404 | cpu->sample.time = 0; | 1407 | cpu->sample.time = 0; |
1405 | cpufreq_add_update_util_hook(cpu_num, &cpu->update_util, | 1408 | cpufreq_add_update_util_hook(cpu_num, &cpu->update_util, |
@@ -1440,8 +1443,6 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy) | |||
1440 | if (!policy->cpuinfo.max_freq) | 1443 | if (!policy->cpuinfo.max_freq) |
1441 | return -ENODEV; | 1444 | return -ENODEV; |
1442 | 1445 | ||
1443 | intel_pstate_clear_update_util_hook(policy->cpu); | ||
1444 | |||
1445 | pr_debug("set_policy cpuinfo.max %u policy->max %u\n", | 1446 | pr_debug("set_policy cpuinfo.max %u policy->max %u\n", |
1446 | policy->cpuinfo.max_freq, policy->max); | 1447 | policy->cpuinfo.max_freq, policy->max); |
1447 | 1448 | ||