Skip to contentSkip to conversation

ARM: EXYNOS: Use wfi macro in platform_do_lowpower

PATCH New Leela Krishna Amudala 4 participants 6 messages May 22, 2014 – May 27, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: EXYNOS: Use wfi macro in platform_do_lowpower

This patch is originally based on commit b3377d186572 ("ARM: 7064/1:
vexpress: Use wfi macro in platform_do_lowpower.")

Current Exynos CPU hotplug code includes a hardcoded WFI instruction, in ARM encoding. When the kernel is compiled in Thumb-2 mode, this is invalid and causes the machine to hang hard when a CPU is offlined.

Use wfi macro instead of the hardcoded WFI instruction.

---
 arch/arm/mach-exynos/hotplug.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
arch/arm/mach-exynos/hotplug.c +1 -7
index 69fa483..8a134d0 100644
@@ -46,13 +46,7 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
 		if (cpu == 1)
 			exynos_cpu_power_down(cpu);
 
-		/*
-		 * here's the WFI
-		 */
-		asm(".word	0xe320f003\n"
-		    :
-		    :
-		    : "memory", "cc");
+		wfi();
 
 		if (pen_release == cpu_logical_map(cpu)) {
 			/*
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 ARM: EXYNOS: Use wfi macro in platform_do_lowpower

Quoted 9 lines · Leela Krishna Amudala

This patch is originally based on commit b3377d186572 ("ARM: 7064/1:
vexpress: Use wfi macro in platform_do_lowpower.")

Current Exynos CPU hotplug code includes a hardcoded WFI instruction, in ARM encoding. When the kernel is compiled in Thumb-2 mode, this is invalid and causes the machine to hang hard when a CPU is offlined.

Use wfi macro instead of the hardcoded WFI instruction.

Is it possible to change it for cpu_do_idle() ?

I guess, that should be backported to the previous kernel version, right ? (Cc stable@).

Thanks
-- Daniel

Quoted 25 lines
---
  arch/arm/mach-exynos/hotplug.c |    8 +-------
  1 file changed, 1 insertion(+), 7 deletions(-)
arch/arm/mach-exynos/hotplug.c +1 -7
index 69fa483..8a134d0 100644
@@ -46,13 +46,7 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
  		if (cpu == 1)
  			exynos_cpu_power_down(cpu);
 
-		/*
-		 * here's the WFI
-		 */
-		asm(".word	0xe320f003\n"
-		    :
-		    :
-		    : "memory", "cc");
+		wfi();
 
  		if (pen_release == cpu_logical_map(cpu)) {
  			/*
Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#2 lore raw

PATCH 1/1 ARM: EXYNOS: Use wfi macro in platform_do_lowpower

Quoted 4 lines · Daniel Lezcano
Quoted 3 lines · Leela Krishna Amudala

This patch is originally based on commit b3377d186572 ("ARM: 7064/1:
vexpress: Use wfi macro in platform_do_lowpower.")

Quoted 8 lines
Quoted 6 lines

Current Exynos CPU hotplug code includes a hardcoded WFI instruction, in ARM encoding. When the kernel is compiled in Thumb-2 mode, this is invalid and causes the machine to hang hard when a CPU is offlined.

Use wfi macro instead of the hardcoded WFI instruction.

Is it possible to change it for cpu_do_idle() ?

Please let's not encourage every wfi() to be turned into cpu_do_idle(). They are not always equivalent. And semantically they are not.

Nicolas

#3 lore raw

PATCH 1/1 ARM: EXYNOS: Use wfi macro in platform_do_lowpower

In reply to Leela Krishna Amudala
Quoted 11 lines · Leela Krishna Amudala

This patch is originally based on commit b3377d186572 ("ARM: 7064/1:
vexpress: Use wfi macro in platform_do_lowpower.")

Current Exynos CPU hotplug code includes a hardcoded WFI instruction, in ARM encoding. When the kernel is compiled in Thumb-2 mode, this is invalid and causes the machine to hang hard when a CPU is offlined.

Use wfi macro instead of the hardcoded WFI instruction.

Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#4 lore raw

PATCH 1/1 ARM: EXYNOS: Use wfi macro in platform_do_lowpower

Hi Kgene,

Quoted 10 lines · Daniel Lezcano
Quoted 9 lines · Leela Krishna Amudala

This patch is originally based on commit b3377d186572 ("ARM: 7064/1:
vexpress: Use wfi macro in platform_do_lowpower.")

Current Exynos CPU hotplug code includes a hardcoded WFI instruction, in ARM encoding. When the kernel is compiled in Thumb-2 mode, this is invalid and causes the machine to hang hard when a CPU is offlined.

Quoted 7 lines
Quoted 3 lines

Use wfi macro instead of the hardcoded WFI instruction.

Can you please take action on this patch.

Best Regards,
Leela Krishna.

Quoted 9 lines

--
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

Applied
#5 lore raw

PATCH 1/1 ARM: EXYNOS: Use wfi macro in platform_do_lowpower

Quoted 2 lines · Leela Krishna Amudala

Hi Kgene,

Hi,

Quoted 15 lines
Quoted 12 lines · Daniel Lezcano
Quoted 11 lines · Leela Krishna Amudala

This patch is originally based on commit b3377d186572 ("ARM: 7064/1:
vexpress: Use wfi macro in platform_do_lowpower.")

Current Exynos CPU hotplug code includes a hardcoded WFI instruction, in ARM encoding. When the kernel is compiled in Thumb-2 mode, this is invalid and causes the machine to hang hard when a CPU is offlined.

Use wfi macro instead of the hardcoded WFI instruction.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Can you please take action on this patch.

Applied, thanks.

- Kukjin