WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] x86: fix powernow

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] x86: fix powernow
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Fri, 19 Sep 2008 14:56:24 +0100
Delivery-date: Fri, 19 Sep 2008 06:56:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
... by allocating the necessary cpufreq_policy structures.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: 2008-09-19/xen/arch/x86/acpi/cpufreq/powernow.c
===================================================================
--- 2008-09-19.orig/xen/arch/x86/acpi/cpufreq/powernow.c        2008-09-19 
13:44:18.000000000 +0200
+++ 2008-09-19/xen/arch/x86/acpi/cpufreq/powernow.c     2008-09-19 
15:44:48.000000000 +0200
@@ -283,9 +283,27 @@ int powernow_cpufreq_init(void)
 
     /* setup cpufreq infrastructure */
     for_each_online_cpu(i) {
-        cpufreq_cpu_policy[i]->cpu = i;
+        struct cpufreq_policy *policy = cpufreq_cpu_policy[i];
 
-        ret = powernow_cpufreq_cpu_init(cpufreq_cpu_policy[i]);
+        if (!policy) {
+            unsigned int firstcpu;
+
+            firstcpu = first_cpu(processor_pminfo[i]->perf.shared_cpu_map);
+            if (i == firstcpu) {
+                policy = xmalloc(struct cpufreq_policy);
+                if (!policy) {
+                    ret = -ENOMEM;
+                    goto cpufreq_init_out;
+                }
+                memset(policy, 0, sizeof(struct cpufreq_policy));
+                policy->cpu = i;
+            } else
+                policy = cpufreq_cpu_policy[firstcpu];
+            cpu_set(i, policy->cpus);
+            cpufreq_cpu_policy[i] = policy;
+        }
+
+        ret = powernow_cpufreq_cpu_init(policy);
         if (ret)
             goto cpufreq_init_out;
     }




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] x86: fix powernow, Jan Beulich <=