Skip to contentSkip to conversation

ARM: use cpu_do_idle for entering wfi mode

PATCH New Sanjay Singh Rawat 8 participants 24 messages May 27, 2013 – Jun 12, 2013

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

cover ARM: use cpu_do_idle for entering wfi mode

With this patch set we make use of cpu_do_idle to enter WFI mode, many platform are not clearing the data buffer before WFI or directly using the address instead of opcode. For the rest its good to have a common approach.

Sanjay Singh Rawat (8):
ARM: EXYNOS: use generic cpu idle function for wfi
ARM: RealView: use generic cpu idle function for wfi
ARM: SPEAr: use generic cpu idle function for wfi
ARM: vexpress: use generic cpu idle function for wfi
ARM: zynq: use generic cpu idle function for wfi
ARM: ux500: use generic cpu idle function for wfi
ARM: msm: use generic cpu idle function for wfi
ARM: PRIMA2: use generic cpu idle function for wfi

 arch/arm/mach-exynos/hotplug.c   |    9 ++-------
 arch/arm/mach-msm/hotplug.c      |    9 ++-------
 arch/arm/mach-prima2/hotplug.c   |    4 ++--
 arch/arm/mach-realview/hotplug.c |    9 ++-------
 arch/arm/mach-spear/hotplug.c    |    3 ++-
 arch/arm/mach-ux500/hotplug.c    |    5 +++--
 arch/arm/mach-vexpress/hotplug.c |    3 ++-
 arch/arm/mach-zynq/hotplug.c     |    4 ++--
 8 files changed, 17 insertions(+), 29 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/8 ARM: EXYNOS: use generic cpu idle function for wfi

use cpu_do_idle for entering the WFI mode.

---
 arch/arm/mach-exynos/hotplug.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
arch/arm/mach-exynos/hotplug.c +2 -7
index af90cfa..7fcedd8 100644
@@ -98,13 +98,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
 		if (cpu == 1)
 			__raw_writel(0, S5P_ARM_CORE1_CONFIGURATION);
 
-		/*
-		 * here's the WFI
-		 */
-		asm(".word	0xe320f003\n"
-		    :
-		    :
-		    : "memory", "cc");
+		/* enter WFI mode */
+		cpu_do_idle();
 
 		if (pen_release == cpu_logical_map(cpu)) {
 			/*
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/8 ARM: EXYNOS: use generic cpu idle function for wfi

Hello Kukjin,

can you please review the patch?

Quoted 27 lines · Sanjay Singh Rawat

use cpu_do_idle for entering the WFI mode.

---
  arch/arm/mach-exynos/hotplug.c |    9 ++-------
  1 file changed, 2 insertions(+), 7 deletions(-)
arch/arm/mach-exynos/hotplug.c +2 -7
index af90cfa..7fcedd8 100644
@@ -98,13 +98,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
  		if (cpu == 1)
  			__raw_writel(0, S5P_ARM_CORE1_CONFIGURATION);
 
-		/*
-		 * here's the WFI
-		 */
-		asm(".word	0xe320f003\n"
-		    :
-		    :
-		    : "memory", "cc");
+		/* enter WFI mode */
+		cpu_do_idle();
 
  		if (pen_release == cpu_logical_map(cpu)) {
  			/*
#3 lore raw

PATCH 2/8 ARM: RealView: use generic cpu idle function for wfi

In reply to Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode

---
 arch/arm/mach-realview/hotplug.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
arch/arm/mach-realview/hotplug.c +2 -7
index ac22dd4..c42022b 100644
@@ -59,13 +59,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
 	 * code will have already disabled interrupts
 	 */
 	for (;;) {
-		/*
-		 * here's the WFI
-		 */
-		asm(".word	0xe320f003\n"
-		    :
-		    :
-		    : "memory", "cc");
+		/* enter WFI mode */
+		cpu_do_idle();
 
 		if (pen_release == cpu_logical_map(cpu)) {
 			/*
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 2/8 ARM: RealView: use generic cpu idle function for wfi

Hello Russell,

can you please review this patch?

Quoted 28 lines · Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode

---
  arch/arm/mach-realview/hotplug.c |    9 ++-------
  1 file changed, 2 insertions(+), 7 deletions(-)
arch/arm/mach-realview/hotplug.c +2 -7
index ac22dd4..c42022b 100644
@@ -59,13 +59,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
  	 * code will have already disabled interrupts
  	 */
  	for (;;) {
-		/*
-		 * here's the WFI
-		 */
-		asm(".word	0xe320f003\n"
-		    :
-		    :
-		    : "memory", "cc");
+		/* enter WFI mode */
+		cpu_do_idle();
 
  		if (pen_release == cpu_logical_map(cpu)) {
  			/*
#5 lore raw

PATCH 3/8 ARM: SPEAr: use generic cpu idle function for wfi

In reply to Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode.

---
 arch/arm/mach-spear/hotplug.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-spear/hotplug.c +2 -1
index d97749c..6dbd3dc 100644
@@ -55,7 +55,8 @@ static inline void cpu_leave_lowpower(void)
 static inline void spear13xx_do_lowpower(unsigned int cpu, int *spurious)
 {
 	for (;;) {
-		wfi();
+		/* enter WFI mode */
+		cpu_do_idle();
 
 		if (pen_release == cpu) {
 			/*
Signature · 1 line
1.7.9.5
#6 lore raw

PATCH 3/8 ARM: SPEAr: use generic cpu idle function for wfi

Quoted 12 lines · Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode.

---
 arch/arm/mach-spear/hotplug.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-spear/hotplug.c +0 -0
index d97749c..6dbd3dc 100644

arch/arm/mach-spear/hotplug.c static inline void cpu_leave_lowpower(void) · line 61

Quoted 8 lines
arch/arm/mach-spear/hotplug.c +2 -1
@@ -55,7 +55,8 @@ static inline void cpu_leave_lowpower(void)
 static inline void spear13xx_do_lowpower(unsigned int cpu, int *spurious)
 {
        for (;;) {
-               wfi();
+               /* enter WFI mode */
+               cpu_do_idle();
 
                if (pen_release == cpu) {
#7 lore raw

PATCH 4/8 ARM: vexpress: use generic cpu idle function for wfi

In reply to Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode.

---
 arch/arm/mach-vexpress/hotplug.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-vexpress/hotplug.c +2 -1
index f0ce6b8..b3dffc2 100644
@@ -60,7 +60,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
 	 * code will have already disabled interrupts
 	 */
 	for (;;) {
-		wfi();
+		/* enter WFI mode */
+		cpu_do_idle();
 
 		if (pen_release == cpu_logical_map(cpu)) {
 			/*
Signature · 1 line
1.7.9.5
#8 lore raw

PATCH 4/8 ARM: vexpress: use generic cpu idle function for wfi

hello Russell, Nicolas,

can you please review this patch?

Quoted 21 lines · Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode.

---
  arch/arm/mach-vexpress/hotplug.c |    3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-vexpress/hotplug.c +2 -1
index f0ce6b8..b3dffc2 100644
@@ -60,7 +60,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
  	 * code will have already disabled interrupts
  	 */
  	for (;;) {
-		wfi();
+		/* enter WFI mode */
+		cpu_do_idle();
 
  		if (pen_release == cpu_logical_map(cpu)) {
  			/*
#9 lore raw

PATCH 4/8 ARM: vexpress: use generic cpu idle function for wfi

Quoted 3 lines · Sanjay Singh Rawat

hello Russell, Nicolas,

can you please review this patch?

I think you may want Pawel to look at this, he usually looks after the Vexpress.

Yours,
Linus Walleij

#10 lore raw

PATCH 4/8 ARM: vexpress: use generic cpu idle function for wfi

In reply to Sanjay Singh Rawat
Quoted 12 lines · Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode.

---
 arch/arm/mach-vexpress/hotplug.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-vexpress/hotplug.c +0 -0
index f0ce6b8..b3dffc2 100644

arch/arm/mach-vexpress/hotplug.c static inline void platform_do_lowpower(unsigned int cpu, int *spurious) · line 67

Quoted 9 lines
arch/arm/mach-vexpress/hotplug.c +2 -1
@@ -60,7 +60,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
 	 * code will have already disabled interrupts
 	 */
 	for (;;) {
-		wfi();
+		/* enter WFI mode */
+		cpu_do_idle();
 
 		if (pen_release == cpu_logical_map(cpu)) {
 			/*

I probably don't get the whole picture, but may I ask what is the rationale behind this change? As in: why cpu_do_idle() is better?

Pawe?

#11 lore raw

PATCH 4/8 ARM: vexpress: use generic cpu idle function for wfi

commit: 8553cb67d2318db327071018fc81084cbabccc46 explains that

-sanjay

Quoted 29 lines · Pawel Moll
Quoted 12 lines · Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode.

---
  arch/arm/mach-vexpress/hotplug.c |    3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-vexpress/hotplug.c +0 -0
index f0ce6b8..b3dffc2 100644

arch/arm/mach-vexpress/hotplug.c static inline void platform_do_lowpower(unsigned int cpu, int *spurious) · line 67

Quoted 9 lines
arch/arm/mach-vexpress/hotplug.c +2 -1
@@ -60,7 +60,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
  	 * code will have already disabled interrupts
  	 */
  	for (;;) {
-		wfi();
+		/* enter WFI mode */
+		cpu_do_idle();
 
  		if (pen_release == cpu_logical_map(cpu)) {
  			/*

I probably don't get the whole picture, but may I ask what is the rationale behind this change? As in: why cpu_do_idle() is better?

Pawe?

#12 lore raw

PATCH 4/8 ARM: vexpress: use generic cpu idle function for wfi

Quoted 19 lines · Sanjay Singh Rawat
Quoted 19 lines
Quoted 19 lines

use cpu_do_idle for entering the wfi mode.

---
  arch/arm/mach-vexpress/hotplug.c |    3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-vexpress/hotplug.c +2 -1
index f0ce6b8..b3dffc2 100644
@@ -60,7 +60,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
  	 * code will have already disabled interrupts
  	 */
  	for (;;) {
-		wfi();
+		/* enter WFI mode */
+		cpu_do_idle();
 
Quoted 7 lines
Quoted 5 lines

arch/arm/mach-vexpress/hotplug.c static inline void platform_do_lowpower(unsigned int cpu, int *spurious) · line 67

Quoted 2 lines
arch/arm/mach-vexpress/hotplug.c +0 -0
  		if (pen_release == cpu_logical_map(cpu)) {
  			/*

I probably don't get the whole picture, but may I ask what is the rationale behind this change? As in: why cpu_do_idle() is better?

commit: 8553cb67d2318db327071018fc81084cbabccc46 explains that

Oh, I've noticed the dsb there, I'm just asking why is it necessary in the cpu_die() case? The core is going down anyway, it left the coherency domain and we could cut the power now (if only it was possible). All cache maintenance (which undoubtedly included dsb) has been long done.

Now, don't get me wrong - I'm not saying it's wrong to do the dsb. I simply would like to know if and why is required (I'm admitting my ignorance here ;-) But if you simply grep-ed for "wfi()" in the whole kernel and automatically replaced them with "cpu_do_idle()", it doesn't make sense.

Regards

Pawel

#13 lore raw

PATCH 4/8 ARM: vexpress: use generic cpu idle function for wfi

Quoted 33 lines · Pawel Moll
Quoted 19 lines · Sanjay Singh Rawat
Quoted 19 lines
Quoted 19 lines

use cpu_do_idle for entering the wfi mode.

---
  arch/arm/mach-vexpress/hotplug.c |    3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-vexpress/hotplug.c +2 -1
index f0ce6b8..b3dffc2 100644
@@ -60,7 +60,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
  	 * code will have already disabled interrupts
  	 */
  	for (;;) {
-		wfi();
+		/* enter WFI mode */
+		cpu_do_idle();
 
Quoted 7 lines
Quoted 5 lines

arch/arm/mach-vexpress/hotplug.c static inline void platform_do_lowpower(unsigned int cpu, int *spurious) · line 67

Quoted 2 lines
arch/arm/mach-vexpress/hotplug.c +0 -0
  		if (pen_release == cpu_logical_map(cpu)) {
  			/*

I probably don't get the whole picture, but may I ask what is the rationale behind this change? As in: why cpu_do_idle() is better?

commit: 8553cb67d2318db327071018fc81084cbabccc46 explains that

Oh, I've noticed the dsb there, I'm just asking why is it necessary in the cpu_die() case? The core is going down anyway, it left the coherency domain and we could cut the power now (if only it was possible). All cache maintenance (which undoubtedly included dsb) has been long done.

Quoted 5 lines

Now, don't get me wrong - I'm not saying it's wrong to do the dsb. I simply would like to know if and why is required (I'm admitting my ignorance here ;-) But if you simply grep-ed for "wfi()" in the whole kernel and automatically replaced them with "cpu_do_idle()", it doesn't make sense.

That's my feeling too. There is a semantic difference between calling cpu_do_idle() and executing a WFI inline. I'd use cpu_do_idle() only in those cases where the call is expected to return and keep the inlined WFI otherwise (with the added DSB when necessary which is not all cases as explained above).

Nicolas

#14 lore raw

PATCH 4/8 ARM: vexpress: use generic cpu idle function for wfi

Pawel, Nicolas,

Thanks for the clarification :), dropping.

sanjay

Quoted 49 lines · Nicolas Pitre
Quoted 33 lines · Pawel Moll
Quoted 19 lines · Sanjay Singh Rawat
Quoted 19 lines
Quoted 19 lines

use cpu_do_idle for entering the wfi mode.

---
   arch/arm/mach-vexpress/hotplug.c |    3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-vexpress/hotplug.c +2 -1
index f0ce6b8..b3dffc2 100644
@@ -60,7 +60,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
   	 * code will have already disabled interrupts
   	 */
   	for (;;) {
-		wfi();
+		/* enter WFI mode */
+		cpu_do_idle();
 
Quoted 7 lines
Quoted 5 lines

arch/arm/mach-vexpress/hotplug.c static inline void platform_do_lowpower(unsigned int cpu, int *spurious) · line 67

Quoted 2 lines
arch/arm/mach-vexpress/hotplug.c +0 -0
   		if (pen_release == cpu_logical_map(cpu)) {
   			/*

I probably don't get the whole picture, but may I ask what is the rationale behind this change? As in: why cpu_do_idle() is better?

commit: 8553cb67d2318db327071018fc81084cbabccc46 explains that

Oh, I've noticed the dsb there, I'm just asking why is it necessary in the cpu_die() case? The core is going down anyway, it left the coherency domain and we could cut the power now (if only it was possible). All cache maintenance (which undoubtedly included dsb) has been long done.

Quoted 5 lines

Now, don't get me wrong - I'm not saying it's wrong to do the dsb. I simply would like to know if and why is required (I'm admitting my ignorance here ;-) But if you simply grep-ed for "wfi()" in the whole kernel and automatically replaced them with "cpu_do_idle()", it doesn't make sense.

That's my feeling too. There is a semantic difference between calling cpu_do_idle() and executing a WFI inline. I'd use cpu_do_idle() only in those cases where the call is expected to return and keep the inlined WFI otherwise (with the added DSB when necessary which is not all cases as explained above).

Nicolas

#15 lore raw

PATCH 5/8 ARM: zynq: use generic cpu idle function for wfi

In reply to Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode.

---
 arch/arm/mach-zynq/hotplug.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-zynq/hotplug.c +2 -2
index c89672b..ef0d65d 100644
@@ -64,8 +64,8 @@ static inline void zynq_platform_do_lowpower(unsigned int cpu, int *spurious)
 	 * code will have already disabled interrupts
 	 */
 	for (;;) {
-		dsb();
-		wfi();
+		/* enter WFI mode */
+		cpu_do_idle();
 
 		/*
 		 * Getting here, means that we have come out of WFI without
Signature · 1 line
1.7.9.5
Applied
#16 lore raw

PATCH 5/8 ARM: zynq: use generic cpu idle function for wfi

Quoted 13 lines · Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode.

---
 arch/arm/mach-zynq/hotplug.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-zynq/hotplug.c +0 -0
index c89672b..ef0d65d 100644

arch/arm/mach-zynq/hotplug.c static inline void zynq_platform_do_lowpower(unsigned int cpu, int *spurious) · line 71

Quoted 10 lines
arch/arm/mach-zynq/hotplug.c +2 -2
@@ -64,8 +64,8 @@ static inline void zynq_platform_do_lowpower(unsigned int cpu, int *spurious)
 	 * code will have already disabled interrupts
 	 */
 	for (;;) {
-		dsb();
-		wfi();
+		/* enter WFI mode */
+		cpu_do_idle();
 
 		/*
 		 * Getting here, means that we have come out of WFI without

Applied to zynq/cleanup branch.

Thanks,
Michal

Signature · 14 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130529/663c5f5e/attachment.sig>
#17 lore raw

PATCH 6/8 ARM: ux500: use generic cpu idle function for wfi

In reply to Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode.

---
 arch/arm/mach-ux500/hotplug.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-ux500/hotplug.c +3 -2
index 2bc00b0..f4ded92 100644
@@ -25,8 +25,9 @@ void __ref ux500_cpu_die(unsigned int cpu)
 {
 	/* directly enter low power state, skipping secure registers */
 	for (;;) {
-		__asm__ __volatile__("dsb\n\t" "wfi\n\t"
-				: : : "memory");
+		/* enter WFI mode */
+		cpu_do_idle();
+
 		if (pen_release == cpu_logical_map(cpu)) {
 			/*
 			 * OK, proper wakeup, we're done
Signature · 1 line
1.7.9.5
#18 lore raw

PATCH 6/8 ARM: ux500: use generic cpu idle function for wfi

Quoted 12 lines · Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode.

---
 arch/arm/mach-ux500/hotplug.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-ux500/hotplug.c +0 -0
index 2bc00b0..f4ded92 100644

arch/arm/mach-ux500/hotplug.c void __ref ux500_cpu_die(unsigned int cpu) · line 30

Quoted 8 lines
arch/arm/mach-ux500/hotplug.c +3 -2
@@ -25,8 +25,9 @@ void __ref ux500_cpu_die(unsigned int cpu)
 {
 	/* directly enter low power state, skipping secure registers */
 	for (;;) {
-		__asm__ __volatile__("dsb\n\t" "wfi\n\t"
-				: : : "memory");
+		/* enter WFI mode */
+		cpu_do_idle();
+

srinidhi

Quoted 6 lines
arch/arm/mach-ux500/hotplug.c +0 -0
 		if (pen_release == cpu_logical_map(cpu)) {
 			/*
 			 * OK, proper wakeup, we're done
Signature · 1 line
1.7.9.5
#19 lore raw

PATCH 7/8 ARM: msm: use generic cpu idle function for wfi

In reply to Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode.

---
 arch/arm/mach-msm/hotplug.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
arch/arm/mach-msm/hotplug.c +2 -7
index 326a872..1b03e5f 100644
@@ -26,13 +26,8 @@ static inline void platform_do_lowpower(unsigned int cpu)
 {
 	/* Just enter wfi for now. TODO: Properly shut off the cpu. */
 	for (;;) {
-		/*
-		 * here's the WFI
-		 */
-		asm("wfi"
-		    :
-		    :
-		    : "memory", "cc");
+		/* enter WFI mode */
+		cpu_do_idle();
 
 		if (pen_release == cpu_logical_map(cpu)) {
 			/*
Signature · 1 line
1.7.9.5
#20 lore raw

PATCH 7/8 ARM: msm: use generic cpu idle function for wfi

Quoted 6 lines · Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode.

---
 arch/arm/mach-msm/hotplug.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
Signature · 3 lines
sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#21 lore raw

PATCH 7/8 ARM: msm: use generic cpu idle function for wfi

In reply to Sanjay Singh Rawat
Quoted 6 lines · Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode.

---
arch/arm/mach-msm/hotplug.c | 9 ++-------

1 file changed, 2 insertions(+), 7 deletions(-)
Signature · 3 lines
sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#22 lore raw

PATCH 8/8 ARM: PRIMA2: use generic cpu idle function for wfi

In reply to Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode.

---
 arch/arm/mach-prima2/hotplug.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-prima2/hotplug.c +2 -2
index 0ab2f8b..68d2903 100644
@@ -16,8 +16,8 @@ static inline void platform_do_lowpower(unsigned int cpu)
 {
 	/* we put the platform to just WFI */
 	for (;;) {
-		__asm__ __volatile__("dsb\n\t" "wfi\n\t"
-			: : : "memory");
+		cpu_do_idle();
+
 		if (pen_release == cpu_logical_map(cpu)) {
 			/*
 			 * OK, proper wakeup, we're done
Signature · 1 line
1.7.9.5
#23 lore raw

PATCH 8/8 ARM: PRIMA2: use generic cpu idle function for wfi

Hello Barry,

Sorry i missed you in the initial mail. Can you please review the patch.

thanks,
sanjay

Quoted 23 lines · Sanjay Singh Rawat

use cpu_do_idle for entering the wfi mode.

---
  arch/arm/mach-prima2/hotplug.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-prima2/hotplug.c +2 -2
index 0ab2f8b..68d2903 100644
@@ -16,8 +16,8 @@ static inline void platform_do_lowpower(unsigned int cpu)
  {
  	/* we put the platform to just WFI */
  	for (;;) {
-		__asm__ __volatile__("dsb\n\t" "wfi\n\t"
-			: : : "memory");
+		cpu_do_idle();
+
  		if (pen_release == cpu_logical_map(cpu)) {
  			/*
  			 * OK, proper wakeup, we're done