mvebu: disable cpu idle on a38x
[openwrt.git] / target / linux / mvebu / patches-3.18 / 031-disable_cpu_idle_on_armada_38x.patch
1 On Armada 38x SoCs, under heavy I/O load, the system hangs when CPU
2 Idle is enabled. Waiting for a solution to this issue, this patch
3 disables the CPU Idle support for this SoC.
4
5 As CPU Hot plug support also uses some of the CPU Idle functions it is
6 also affected by the same issue. This patch disables it also for the
7 Armada 38x SoCs.
8
9 Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
10 Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
11 Cc: <stable@vger.kernel.org> # v3.17 +
12 ---
13 Hi,
14
15 In this version I removed the unneeded initialization of the ret
16 variable, I also fixed the warning message, and finally I added the
17 Tested-by from Thomas.
18
19 Gregory
20
21  arch/arm/mach-mvebu/pmsu.c | 16 +++++++++++++++-
22  1 file changed, 15 insertions(+), 1 deletion(-)
23
24 --- a/arch/arm/mach-mvebu/pmsu.c
25 +++ b/arch/arm/mach-mvebu/pmsu.c
26 @@ -415,6 +415,9 @@ static __init int armada_38x_cpuidle_ini
27         void __iomem *mpsoc_base;
28         u32 reg;
29  
30 +       pr_warn("CPU idle is currently broken on Armada 38x: disabling");
31 +       return 0;
32 +
33         np = of_find_compatible_node(NULL, NULL,
34                                      "marvell,armada-380-coherency-fabric");
35         if (!np)
36 @@ -476,6 +479,16 @@ static int __init mvebu_v7_cpu_pm_init(v
37                 return 0;
38         of_node_put(np);
39  
40 +       /*
41 +        * Currently the CPU idle support for Armada 38x is broken, as
42 +        * the CPU hotplug uses some of the CPU idle functions it is
43 +        * broken too, so let's disable it
44 +        */
45 +       if (of_machine_is_compatible("marvell,armada380")) {
46 +               cpu_hotplug_disable();
47 +               pr_warn("CPU hotplug support is currently broken on Armada 38x: disabling");
48 +       }
49 +
50         if (of_machine_is_compatible("marvell,armadaxp"))
51                 ret = armada_xp_cpuidle_init();
52         else if (of_machine_is_compatible("marvell,armada370"))
53 @@ -489,7 +502,8 @@ static int __init mvebu_v7_cpu_pm_init(v
54                 return ret;
55  
56         mvebu_v7_pmsu_enable_l2_powerdown_onidle();
57 -       platform_device_register(&mvebu_v7_cpuidle_device);
58 +       if (mvebu_v7_cpuidle_device.name)
59 +               platform_device_register(&mvebu_v7_cpuidle_device);
60         cpu_pm_register_notifier(&mvebu_v7_cpu_pm_notifier);
61  
62         return 0;