Skip to contentSkip to conversation

cpufreq: P state stats aren't available if there is no cpufreq driver

PATCH New David Vrabel 1 participant 1 message Aug 2, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: P state stats aren't available if there is no cpufreq driver

From: David Vrabel <[email protected]>

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.

---
 xen/drivers/acpi/pmstat.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
xen/drivers/acpi/pmstat.c +2 -0
index 8788f01..698711e 100644
@@ -66,6 +66,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;
Signature · 1 line
1.7.2.5