linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [RFC] cpufreq: can't raise max frequency with cpu_thermal
@ 2012-12-18  8:29 Sonny Rao
  2012-12-18 16:03 ` Doug Anderson
  2012-12-19  4:17 ` amit daniel kachhap
  0 siblings, 2 replies; 6+ messages in thread
From: Sonny Rao @ 2012-12-18  8:29 UTC (permalink / raw)
  To: linux-pm
  Cc: linux-kernel, Zhang Rui, Amit Daniel Kachhap, Doug Anderson,
	Sameer Nanda, Sonny Rao

The cpu_thermal generic thermal management code has a bug where once
max cpu frequency has been lowered in sysfs (scaling_max_freq) it is
not possible to raise the max back up later.  The bug is that the
notifer gets called by __cpufreq_set_policy() before the user policy
max is raised, and is incorrectly trying to enforce the max frequency
policy even when we are trying to change the policy.  It is also not
clear why this driver is looking at the user policy since it is
primarily supposed to enforce thermal policy, not user set policy.

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
---
 drivers/thermal/cpu_cooling.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index 836828e..63bc708 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -219,10 +219,6 @@ static int cpufreq_thermal_notifier(struct notifier_block *nb,
 	if (cpumask_test_cpu(policy->cpu, &notify_device->allowed_cpus))
 		max_freq = notify_device->cpufreq_val;
 
-	/* Never exceed user_policy.max*/
-	if (max_freq > policy->user_policy.max)
-		max_freq = policy->user_policy.max;
-
 	if (policy->max != max_freq)
 		cpufreq_verify_within_limits(policy, 0, max_freq);
 
-- 
1.7.7.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-12-29 21:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-18  8:29 [PATCH] [RFC] cpufreq: can't raise max frequency with cpu_thermal Sonny Rao
2012-12-18 16:03 ` Doug Anderson
2012-12-19  4:17 ` amit daniel kachhap
2012-12-19  5:45   ` Doug Anderson
2012-12-26 19:32     ` amit daniel kachhap
2012-12-29 21:04       ` Sonny Rao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).