xen/arm: disable cpuidle and cpufreq when linux is running as dom0
authorJulien Grall <julien.grall@linaro.org>
Mon, 9 Sep 2013 11:35:26 +0000 (11:35 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Mon, 9 Sep 2013 11:35:26 +0000 (11:35 +0000)
When linux is running as dom0, Xen doesn't show the physical cpu but a
virtual CPU.
On some ARM SOC (for instance the exynos 5250), linux registers callbacks
for cpuidle and cpufreq. When these callbacks are called, they will modify
directly the physical cpu not the virtual one. It can impact the whole board
instead of only dom0.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
arch/arm/xen/enlighten.c

index e70ce04e9dad0c83b8058f93f7814a1e207bb51a..79b317a5e480a1120c2c6bfb5e398caa3cd16135 100644 (file)
@@ -21,6 +21,8 @@
 #include <linux/of.h>
 #include <linux/of_irq.h>
 #include <linux/of_address.h>
+#include <linux/cpuidle.h>
+#include <linux/cpufreq.h>
 
 #include <linux/mm.h>
 
@@ -266,6 +268,13 @@ static int __init xen_guest_init(void)
        if (!xen_initial_domain())
                xenbus_probe(NULL);
 
+       /*
+        * Making sure board specific code will not set up ops for
+        * cpu idle and cpu freq.
+        */
+       disable_cpuidle();
+       disable_cpufreq();
+
        return 0;
 }
 core_initcall(xen_guest_init);