Skip to contentSkip to conversation

sparc32,leon: SMP power down implementation

PATCH Applied Daniel Hellstrom 2 participants 3 messages Apr 26, 2011 – May 16, 2011 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc32,leon: SMP power down implementation

---
 arch/sparc/kernel/process_32.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
arch/sparc/kernel/process_32.c +10 -2
index 1752929..c8cc461 100644
@@ -128,8 +128,16 @@ void cpu_idle(void)
         set_thread_flag(TIF_POLLING_NRFLAG);
 	/* endless idle loop with no priority at all */
 	while(1) {
-		while (!need_resched())
-			cpu_relax();
+#ifdef CONFIG_SPARC_LEON
+		if (pm_idle) {
+			while (!need_resched())
+				(*pm_idle)();
+		} else
+#endif
+		{
+			while (!need_resched())
+				cpu_relax();
+		}
 		preempt_enable_no_resched();
 		schedule();
 		preempt_disable();
Signature · 1 line
1.5.4
#1 lore raw
Quoted 17 lines · Daniel Hellstrom

---
arch/sparc/kernel/process_32.c | 12 ++++++++++--

1 files changed, 10 insertions(+), 2 deletions(-)
arch/sparc/kernel/process_32.c +2 -2
index 1752929..c8cc461 100644
@@ -128,8 +128,16 @@ void cpu_idle(void)
        set_thread_flag(TIF_POLLING_NRFLAG);
 	/* endless idle loop with no priority at all */
 	while(1) {
-		while (!need_resched())
-			cpu_relax();
+#ifdef CONFIG_SPARC_LEON
+		if (pm_idle) {

arch/sparc/kernel/process_32.c void cpu_idle(void) · line 142

Quoted 10 lines
arch/sparc/kernel/process_32.c +8 -0
+			while (!need_resched())
+				(*pm_idle)();
+		} else
+#endif
+		{
+			while (!need_resched())
+				cpu_relax();
+		}
 
 

I have made this CONFIG_SPARC_LEON because I'm not sure if other SMP SPARC32 supports the pmc idle. One can see from row 109 above that in single-processor pmc_idle() is called in the same mannor, however no for SMP... perhaps it is a meaning with that? I don't want to break anything, if you think is shuold not be ifdeffed I will remove it and repost.

Daniel