]> xenbits.xensource.com Git - xen.git/commitdiff
cpufreq: P state stats aren't available if there is no cpufreq driver
authorDavid Vrabel <david.vrabel@citrix.com>
Thu, 9 Aug 2012 15:45:12 +0000 (16:45 +0100)
committerDavid Vrabel <david.vrabel@citrix.com>
Thu, 9 Aug 2012 15:45:12 +0000 (16:45 +0100)
If there is no cpufreq driver (e.g., with an AMD Opteron 8212) then
reading the P state statistics causes a deadlock as an uninitialized
spinlock is locked in do_get_pm_info(). The spinlock is initialized in
cpufreq_statistic_init() which is not called if cpufreq_driver ==
NULL.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   25706:7fd5facb6084
xen-unstable date:        Fri Aug 03 09:50:28 2012 +0200

xen/drivers/acpi/pmstat.c

index e0dd9131c6bae3d0a8d548f11e93163e4f8f8cfb..9eb84515657ab41f8f5283db748c10ca6ef644aa 100644 (file)
@@ -68,6 +68,8 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op)
     case PMSTAT_PX:
         if ( !(xen_processor_pmbits & XEN_PROCESSOR_PM_PX) )
             return -ENODEV;
+        if ( !cpufreq_driver )
+            return -ENODEV;
         if ( !pmpt || !(pmpt->perf.init & XEN_PX_INIT) )
             return -EINVAL;
         break;