ARM: mvebu: Disable CPU Idle on Armada 38x
Subsystems (3)
PATCH v2 1/1 ARM: mvebu: Disable CPU Idle on Armada 38x
On Armada 38x SoCs, under heavy I/O load, the system hangs when CPU Idle is enabled. Waiting for a solution to this issue, this patch disables the CPU Idle support for this SoC.
As CPU Hot plug support also uses some of the CPU Idle functions it is also affected by the same issue. This patch disables it also for the Armada 38x SoCs.
---
Hi,
The previous code raised a warning about the unused armada_38x_cpuidle_init() function. So I moved the warn message inside the function itself and then I continued to call this function.
I also fixed a missing bracket.
And finally I only registered the cpuilde platform driver if there was really something to register.
Gregory
arch/arm/mach-mvebu/pmsu.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
arch/arm/mach-mvebu/pmsu.c +16 -2
@@ -415,6 +415,9 @@ static __init int armada_38x_cpuidle_init(void)void __iomem *mpsoc_base;u32 reg; +pr_warn ("CPU Idle is currently broken on Armada 38x: disabling" ); +return 0 ; + np =of_find_compatible_node (NULL ,NULL ,"marvell,armada-380-coherency-fabric" );if (!np)
@@ -469,13 +472,23 @@ static __init int armada_xp_cpuidle_init(void)static int __init mvebu_v7_cpu_pm_init (void ) {struct device_node *np; -int ret; +int ret =0 ; np =of_find_matching_node (NULL , of_pmsu_table);if (!np)return 0 ;of_node_put (np); +/* +* Currently the CPU Idle support for Armada 38x is broken, as +* the CPU Hotplug uses some of the CPU Idle functions it is +* broken too, so let's disable it +*/ +if (of_machine_is_compatible ("marvell,armada380" )) { +cpu_hotplug_disable (); +pr_warn ("CPU Hotplug support is currently broken on Armada 38x: disabling" ); + } +if (of_machine_is_compatible ("marvell,armadaxp" )) ret =armada_xp_cpuidle_init ();else if (of_machine_is_compatible ("marvell,armada370" ))
@@ -489,7 +502,8 @@ static int __init mvebu_v7_cpu_pm_init(void)return ret;mvebu_v7_pmsu_enable_l2_powerdown_onidle (); -platform_device_register (&mvebu_v7_cpuidle_device); +if (mvebu_v7_cpuidle_device.name) +platform_device_register (&mvebu_v7_cpuidle_device);cpu_pm_register_notifier (&mvebu_v7_cpu_pm_notifier);return 0 ;
Signature · 1 line
2.1.0
PATCH v2 1/1 ARM: mvebu: Disable CPU Idle on Armada 38x
Dear Gregory CLEMENT,
Quoted 10 lines · Gregory CLEMENT
On Armada 38x SoCs, under heavy I/O load, the system hangs when CPU Idle is enabled. Waiting for a solution to this issue, this patch disables the CPU Idle support for this SoC.
As CPU Hot plug support also uses some of the CPU Idle functions it is also affected by the same issue. This patch disables it also for the Armada 38x SoCs.
Signed-off-by Gregory CLEMENT <[email protected]>Cc <[email protected]> # v3.17 +
I tested on Armada 38x, and indeed CPU hotplug is properly disabled, and it doesn't prevent suspend/resume (not supported yet in mainline, but hopefully soon to be supported).
Some minor comments below.
arch/arm/mach-mvebu/pmsu.c static __init int armada_38x_cpuidle_init(void) · line 418
Quoted 9 lines
arch/arm/mach-mvebu/pmsu.c +1
-0@@ -415,6 +415,9 @@ static __init int armada_38x_cpuidle_init(void)void __iomem *mpsoc_base;u32 reg; +pr_warn ("CPU Idle is currently broken on Armada 38x: disabling" );
Idle -> idle
arch/arm/mach-mvebu/pmsu.c static __init int armada_xp_cpuidle_init(void) · line 475
Quoted 11 lines
arch/arm/mach-mvebu/pmsu.c +3
-1+return 0 ; + np =of_find_compatible_node (NULL ,NULL ,"marvell,armada-380-coherency-fabric" );if (!np)@@ -469,13 +472,23 @@ static __init int armada_xp_cpuidle_init(void)static int __init mvebu_v7_cpu_pm_init (void ) {struct device_node *np; -int ret; +int ret =0 ;
Not clear why this change is needed.
Quoted 4 lines
arch/arm/mach-mvebu/pmsu.c +0
-0np =of_find_matching_node (NULL , of_pmsu_table);if (!np)return 0 ;
arch/arm/mach-mvebu/pmsu.c static __init int armada_xp_cpuidle_init(void) · line 489
Quoted 10 lines
arch/arm/mach-mvebu/pmsu.c +8
-0of_node_put (np); +/* +* Currently the CPU Idle support for Armada 38x is broken, as +* the CPU Hotplug uses some of the CPU Idle functions it is +* broken too, so let's disable it +*/ +if (of_machine_is_compatible ("marvell,armada380" )) { +cpu_hotplug_disable (); +pr_warn ("CPU Hotplug support is currently broken on Armada 38x: disabling" );
Hotplug -> hotplug.
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 1/1 ARM: mvebu: Disable CPU Idle on Armada 38x
Hi Thomas,
Quoted 11 lines · Thomas Petazzoni
Dear Gregory CLEMENT,
Quoted 8 lines · Gregory CLEMENT
On Armada 38x SoCs, under heavy I/O load, the system hangs when CPU Idle is enabled. Waiting for a solution to this issue, this patch disables the CPU Idle support for this SoC.
As CPU Hot plug support also uses some of the CPU Idle functions it is also affected by the same issue. This patch disables it also for the Armada 38x SoCs.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Gregory CLEMENT <[email protected]>Cc <[email protected]> # v3.17 +Tested-by Thomas Petazzoni <[email protected]>I tested on Armada 38x, and indeed CPU hotplug is properly disabled, and it doesn't prevent suspend/resume (not supported yet in mainline, but hopefully soon to be supported).
Great!
Quoted 11 lines
Some minor comments below.
Quoted 8 lines
arch/arm/mach-mvebu/pmsu.c +0
-0@@ -415,6 +415,9 @@ static __init int armada_38x_cpuidle_init(void)void __iomem *mpsoc_base;u32 reg;
Quoted 4 lines
arch/arm/mach-mvebu/pmsu.c static __init int armada_38x_cpuidle_init(void) · line 418
Quoted 1 line
arch/arm/mach-mvebu/pmsu.c +1
-0+pr_warn ("CPU Idle is currently broken on Armada 38x: disabling" );Idle -> idle
OK
Quoted 5 lines
Quoted 5 lines
arch/arm/mach-mvebu/pmsu.c +2
-0+return 0 ; + np =of_find_compatible_node (NULL ,NULL ,"marvell,armada-380-coherency-fabric" );if (!np)
Quoted 8 lines
arch/arm/mach-mvebu/pmsu.c static __init int armada_xp_cpuidle_init(void) · line 475
Quoted 6 lines
arch/arm/mach-mvebu/pmsu.c +1
-1@@ -469,13 +472,23 @@ static __init int armada_xp_cpuidle_init(void)static int __init mvebu_v7_cpu_pm_init (void ) {struct device_node *np; -int ret; +int ret =0 ;Not clear why this change is needed.
It was a left over of an older version I will remove it.
Quoted 7 lines
Quoted 7 lines
arch/arm/mach-mvebu/pmsu.c +0
-0np =of_find_matching_node (NULL , of_pmsu_table);if (!np)return 0 ;of_node_put (np);
Quoted 10 lines
arch/arm/mach-mvebu/pmsu.c static __init int armada_xp_cpuidle_init(void) · line 489
Quoted 8 lines
arch/arm/mach-mvebu/pmsu.c +8
-0+/* +* Currently the CPU Idle support for Armada 38x is broken, as +* the CPU Hotplug uses some of the CPU Idle functions it is +* broken too, so let's disable it +*/ +if (of_machine_is_compatible ("marvell,armada380" )) { +cpu_hotplug_disable (); +pr_warn ("CPU Hotplug support is currently broken on Armada 38x: disabling" );Hotplug -> hotplug.
OK
Thanks,
Gregory
Signature · 4 lines
Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com