From: David Vrabel Date: Fri, 3 Aug 2012 07:50:28 +0000 (+0200) Subject: cpufreq: P state stats aren't available if there is no cpufreq driver X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~8097 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e50c91ab1a922304ab0b2af20981c0994b3a7840;p=xen.git cpufreq: P state stats aren't available if there is no cpufreq driver 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 Committed-by: Jan Beulich --- diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c index 8788f01f70..698711e38a 100644 --- a/xen/drivers/acpi/pmstat.c +++ b/xen/drivers/acpi/pmstat.c @@ -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;