diff mbox

ARM: EXYNOS: Use wfi macro in platform_do_lowpower

Message ID 1400745455-27920-1-git-send-email-leela.krishna@linaro.org
State Accepted
Commit b92ad209c26a1891c4e04cd75fc771dcb002603f
Headers show

Commit Message

Leela Krishna Amudala May 22, 2014, 7:57 a.m. UTC
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.

Signed-off-by: Leela Krishna Amudala <leela.krishna@linaro.org>
---
 arch/arm/mach-exynos/hotplug.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Daniel Lezcano May 22, 2014, 11:53 a.m. UTC | #1
On 05/22/2014 09:57 AM, Leela Krishna Amudala wrote:
> 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

> Signed-off-by: Leela Krishna Amudala <leela.krishna@linaro.org>
> ---
>   arch/arm/mach-exynos/hotplug.c |    8 +-------
>   1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c
> index 69fa483..8a134d0 100644
> --- a/arch/arm/mach-exynos/hotplug.c
> +++ b/arch/arm/mach-exynos/hotplug.c
> @@ -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)) {
>   			/*
>
Nicolas Pitre May 22, 2014, 5:55 p.m. UTC | #2
On Thu, 22 May 2014, Daniel Lezcano wrote:

> On 05/22/2014 09:57 AM, Leela Krishna Amudala wrote:
> > 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() ?

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
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Daniel Lezcano May 22, 2014, 7:01 p.m. UTC | #3
On 05/22/2014 09:57 AM, Leela Krishna Amudala wrote:
> 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.
>
> Signed-off-by: Leela Krishna Amudala <leela.krishna@linaro.org>

Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Leela Krishna Amudala May 23, 2014, 6:13 a.m. UTC | #4
Hi Kgene,


On Fri, May 23, 2014 at 12:31 AM, Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
> On 05/22/2014 09:57 AM, Leela Krishna Amudala wrote:
>>
>> 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.
>>
>> Signed-off-by: Leela Krishna Amudala <leela.krishna@linaro.org>
>
>
> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>

Can you please take action on this patch.

Best Regards,
Leela Krishna.

>
>
> --
>  <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
>
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kukjin Kim May 27, 2014, 3:33 p.m. UTC | #5
On 05/23/14 15:13, Leela Krishna Amudala wrote:
> Hi Kgene,
>
Hi,

>
> On Fri, May 23, 2014 at 12:31 AM, Daniel Lezcano
> <daniel.lezcano@linaro.org>  wrote:
>> On 05/22/2014 09:57 AM, Leela Krishna Amudala wrote:
>>>
>>> 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.
>>>
>>> Signed-off-by: Leela Krishna Amudala<leela.krishna@linaro.org>
>>
>>
>> Acked-by: Daniel Lezcano<daniel.lezcano@linaro.org>
>>
>
> Can you please take action on this patch.
>
Applied, thanks.

- Kukjin
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c
index 69fa483..8a134d0 100644
--- a/arch/arm/mach-exynos/hotplug.c
+++ b/arch/arm/mach-exynos/hotplug.c
@@ -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)) {
 			/*