* Re: Should SPARC use cpuidle?
2013-02-12 18:01 ` Should SPARC use cpuidle? (was: linux-next: build failure after merge of the final tree (acpi tree related)) Len Brown
@ 2013-02-12 18:03 ` Len Brown
2013-02-12 19:36 ` Sam Ravnborg
2013-02-12 19:42 ` Should SPARC use cpuidle? (was: linux-next: build failure after merge of the final tree (acpi tree related)) Sam Ravnborg
1 sibling, 1 reply; 4+ messages in thread
From: Len Brown @ 2013-02-12 18:03 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Stephen Rothwell, Len Brown, linux-next, linux-kernel,
David S. Miller, sparclinux, Linux PM list
[-- Attachment #1: Type: text/plain, Size: 337 bytes --]
>> Can you please move the definition of sparc_idle to processor_32.h
>> It is sparc32 specific - and then we do not need the __ASSEMBLY__ guards
>> as the sparc32 variant are not used from assembler.
>
> sure, let me know if attached works.
ugh, not accustomed to sending patches via thunderbird.
hopefully this attachment works...
[-- Attachment #2: 0001-sparc-idle-rename-pm_idle-to-sparc_idle.patch --]
[-- Type: text/x-patch, Size: 4055 bytes --]
>From 358ca5d7e02c4559ad3fbf8135421e4a3753e979 Mon Sep 17 00:00:00 2001
From: Len Brown <len.brown@intel.com>
Date: Sat, 9 Feb 2013 23:27:26 -0500
Subject: [PATCH] sparc idle: rename pm_idle to sparc_idle
Reply-To: Len Brown <lenb@kernel.org>
Organization: Intel Open Source Technology Center
(pm_idle)() is being removed from linux/pm.h
because Linux does not have such a cross-architecture concept.
sparc uses an idle function pointer in its architecture
specific code. So we re-name sparc use of pm_idle to sparc_idle.
Maybe some day, SPARC will cut over to cpuidle...
Signed-off-by: Len Brown <len.brown@intel.com>
Acked-by: David S. Miller <davem@davemloft.net>
---
arch/sparc/include/asm/processor_32.h | 1 +
arch/sparc/kernel/apc.c | 3 ++-
arch/sparc/kernel/leon_pmc.c | 5 +++--
arch/sparc/kernel/pmc.c | 3 ++-
arch/sparc/kernel/process_32.c | 7 +++----
5 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/arch/sparc/include/asm/processor_32.h b/arch/sparc/include/asm/processor_32.h
index c1e0191..2c7baa4 100644
--- a/arch/sparc/include/asm/processor_32.h
+++ b/arch/sparc/include/asm/processor_32.h
@@ -118,6 +118,7 @@ extern unsigned long get_wchan(struct task_struct *);
extern struct task_struct *last_task_used_math;
#define cpu_relax() barrier()
+extern void (*sparc_idle)(void);
#endif
diff --git a/arch/sparc/kernel/apc.c b/arch/sparc/kernel/apc.c
index 348fa1a..eefda32 100644
--- a/arch/sparc/kernel/apc.c
+++ b/arch/sparc/kernel/apc.c
@@ -20,6 +20,7 @@
#include <asm/uaccess.h>
#include <asm/auxio.h>
#include <asm/apc.h>
+#include <asm/processor.h>
/* Debugging
*
@@ -158,7 +159,7 @@ static int apc_probe(struct platform_device *op)
/* Assign power management IDLE handler */
if (!apc_no_idle)
- pm_idle = apc_swift_idle;
+ sparc_idle = apc_swift_idle;
printk(KERN_INFO "%s: power management initialized%s\n",
APC_DEVNAME, apc_no_idle ? " (CPU idle disabled)" : "");
diff --git a/arch/sparc/kernel/leon_pmc.c b/arch/sparc/kernel/leon_pmc.c
index 4e17432..708bca4 100644
--- a/arch/sparc/kernel/leon_pmc.c
+++ b/arch/sparc/kernel/leon_pmc.c
@@ -9,6 +9,7 @@
#include <asm/leon_amba.h>
#include <asm/cpu_type.h>
#include <asm/leon.h>
+#include <asm/processor.h>
/* List of Systems that need fixup instructions around power-down instruction */
unsigned int pmc_leon_fixup_ids[] = {
@@ -69,9 +70,9 @@ static int __init leon_pmc_install(void)
if (sparc_cpu_model == sparc_leon) {
/* Assign power management IDLE handler */
if (pmc_leon_need_fixup())
- pm_idle = pmc_leon_idle_fixup;
+ sparc_idle = pmc_leon_idle_fixup;
else
- pm_idle = pmc_leon_idle;
+ sparc_idle = pmc_leon_idle;
printk(KERN_INFO "leon: power management initialized\n");
}
diff --git a/arch/sparc/kernel/pmc.c b/arch/sparc/kernel/pmc.c
index dcbb62f..8b7297f 100644
--- a/arch/sparc/kernel/pmc.c
+++ b/arch/sparc/kernel/pmc.c
@@ -17,6 +17,7 @@
#include <asm/oplib.h>
#include <asm/uaccess.h>
#include <asm/auxio.h>
+#include <asm/processor.h>
/* Debug
*
@@ -63,7 +64,7 @@ static int pmc_probe(struct platform_device *op)
#ifndef PMC_NO_IDLE
/* Assign power management IDLE handler */
- pm_idle = pmc_swift_idle;
+ sparc_idle = pmc_swift_idle;
#endif
printk(KERN_INFO "%s: power management initialized\n", PMC_DEVNAME);
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c
index be8e862..62eede1 100644
--- a/arch/sparc/kernel/process_32.c
+++ b/arch/sparc/kernel/process_32.c
@@ -43,8 +43,7 @@
* Power management idle function
* Set in pm platform drivers (apc.c and pmc.c)
*/
-void (*pm_idle)(void);
-EXPORT_SYMBOL(pm_idle);
+void (*sparc_idle)(void);
/*
* Power-off handler instantiation for pm.h compliance
@@ -75,8 +74,8 @@ void cpu_idle(void)
/* endless idle loop with no priority at all */
for (;;) {
while (!need_resched()) {
- if (pm_idle)
- (*pm_idle)();
+ if (sparc_idle)
+ (*sparc_idle)();
else
cpu_relax();
}
--
1.8.1.3.535.ga923c31
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: Should SPARC use cpuidle? (was: linux-next: build failure after merge of the final tree (acpi tree related))
2013-02-12 18:01 ` Should SPARC use cpuidle? (was: linux-next: build failure after merge of the final tree (acpi tree related)) Len Brown
2013-02-12 18:03 ` Should SPARC use cpuidle? Len Brown
@ 2013-02-12 19:42 ` Sam Ravnborg
1 sibling, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2013-02-12 19:42 UTC (permalink / raw)
To: Len Brown
Cc: Stephen Rothwell, Len Brown, linux-next, linux-kernel,
David S. Miller, sparclinux, Linux PM list
>
> > Do you btw. have any hints how I can convert to the cpu_idle thing you hinted?
>
> If you have exactly 1 idle state, then cpuidle isn't that interesting,
> except, perhaps the standard residency counters. If you have multiple
> states to choose from, cpuidle becomes more valuable.
>
> There are lots of cpuidle users now, including x86's intel_idle,
> processor_idle, and the entire ARM tree.
I think LEON has only a single power-down state.
The APC stuff I know nothing about :-(
So for now I think I will let it be as it is then.
Sam
^ permalink raw reply [flat|nested] 4+ messages in thread