[CPUFREQ] Do not set policy for offline cpus
authorPrarit Bhargava <prarit@redhat.com>
Mon, 3 Aug 2009 14:58:11 +0000 (10:58 -0400)
committerDave Jones <davej@redhat.com>
Tue, 4 Aug 2009 18:32:10 +0000 (14:32 -0400)
Suspend/Resume fails on multi socket, multi core systems because the cpufreq
code erroneously sets the per_cpu policy_cpu value when a logical cpu is
offline.

This most notably results in missing sysfs files that are used to set the
cpu frequencies of the various cpus.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Dave Jones <davej@redhat.com>
drivers/cpufreq/cpufreq.c

index b90eda8b34409680863edb45bc7b993ed87a1082..120d236c0ffb2f1d704bae087bf80ccb875908c1 100644 (file)
@@ -924,6 +924,8 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
 
        spin_lock_irqsave(&cpufreq_driver_lock, flags);
        for_each_cpu(j, policy->cpus) {
+               if (!cpu_online(j))
+                       continue;
                per_cpu(cpufreq_cpu_data, j) = policy;
                per_cpu(policy_cpu, j) = policy->cpu;
        }