linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] cpufreq: Manage only online cpus
@ 2012-12-16  5:50 Viresh Kumar
  2012-12-16  5:50 ` [PATCH 2/3] cpufreq: Notify governors when cpus are hot-[un]plugged Viresh Kumar
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Viresh Kumar @ 2012-12-16  5:50 UTC (permalink / raw)
  To: rjw, rafael.j.wysocki
  Cc: linaro-dev, nicolas.pitre, amit.kucheria, mathieu.poirier,
	linux-kernel, cpufreq, pdsw-power-team, linux-pm, Viresh Kumar

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

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

end of thread, other threads:[~2013-01-11 22:38 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-16  5:50 [PATCH 1/3] cpufreq: Manage only online cpus Viresh Kumar
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

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).