linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: rjw@sisk.pl, rafael.j.wysocki@intel.com
Cc: linaro-dev@lists.linaro.org, nicolas.pitre@linaro.org,
	amit.kucheria@linaro.org, mathieu.poirier@linaro.org,
	linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org,
	pdsw-power-team@arm.com, linux-pm@vger.kernel.org,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH 1/3] cpufreq: Manage only online cpus
Date: Sun, 16 Dec 2012 11:20:08 +0530	[thread overview]
Message-ID: <98330b2deb910453a356404b8cf774c94326bc42.1355636864.git.viresh.kumar@linaro.org> (raw)

cpufreq core doesn't manage offline cpus and if driver->init() has returned
mask including offline cpus, it may result in unwanted behavior by cpufreq core
or governors.

We need to get only online cpus in this mask. There are two places to fix this
mask, cpufreq core and cpufreq driver. It makes sense to do this at common place
and hence is done in core.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 1f93dbd..de99517 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -970,6 +970,13 @@ static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
 		pr_debug("initialization failed\n");
 		goto err_unlock_policy;
 	}
+
+	/*
+	 * affected cpus must always be the one, which are online. We aren't
+	 * managing offline cpus here.
+	 */
+	cpumask_and(policy->cpus, policy->cpus, cpu_online_mask);
+
 	policy->user_policy.min = policy->min;
 	policy->user_policy.max = policy->max;
 
-- 
1.7.12.rc2.18.g61b472e


             reply	other threads:[~2012-12-16  5:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-16  5:50 Viresh Kumar [this message]
2012-12-16  5:50 ` [PATCH 2/3] cpufreq: Notify governors when cpus are hot-[un]plugged Viresh Kumar
2012-12-16  5:50 ` [PATCH 3/3] cpufreq: Don't use cpu removed during cpufreq_driver_unregister Viresh Kumar
2013-01-03 14:25   ` Srivatsa S. Bhat
2013-01-04  5:19     ` Viresh Kumar
2013-01-04  6:03       ` Srivatsa S. Bhat
2012-12-16 13:04 ` [PATCH 1/3] cpufreq: Manage only online cpus Rafael J. Wysocki
2012-12-16 13:37   ` Viresh Kumar
2013-01-02  6:29     ` Viresh Kumar
2013-01-03  1:13       ` Rafael J. Wysocki
2013-01-03  3:32         ` Viresh Kumar
2013-01-03 12:02           ` Rafael J. Wysocki
2013-01-04  5:14             ` Viresh Kumar
2013-01-04 11:32               ` Rafael J. Wysocki
2013-01-11 22:43 ` Rafael J. Wysocki

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=98330b2deb910453a356404b8cf774c94326bc42.1355636864.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=amit.kucheria@linaro.org \
    --cc=cpufreq@vger.kernel.org \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=nicolas.pitre@linaro.org \
    --cc=pdsw-power-team@arm.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rjw@sisk.pl \
    /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 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).