All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sonny Rao <sonnyrao@chromium.org>
To: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Zhang Rui <rui.zhang@intel.com>,
	Amit Daniel Kachhap <amit.kachhap@linaro.org>,
	Doug Anderson <dianders@chromium.org>,
	Sameer Nanda <snanda@chromium.org>,
	Sonny Rao <sonnyrao@chromium.org>
Subject: [PATCH] [RFC] cpufreq: can't raise max frequency with cpu_thermal
Date: Tue, 18 Dec 2012 00:29:44 -0800	[thread overview]
Message-ID: <1355819384-25983-1-git-send-email-sonnyrao@chromium.org> (raw)

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


             reply	other threads:[~2012-12-18  8:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18  8:29 Sonny Rao [this message]
2012-12-18 16:03 ` [PATCH] [RFC] cpufreq: can't raise max frequency with cpu_thermal 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1355819384-25983-1-git-send-email-sonnyrao@chromium.org \
    --to=sonnyrao@chromium.org \
    --cc=amit.kachhap@linaro.org \
    --cc=dianders@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=snanda@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.