aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-09-14 21:13:43 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-09-28 00:30:02 -0500
commit65d5f68fc7f5f00cd9045246e407c85785df2ed6 (patch)
treebb57ebcfedf9705d21bf876a569af58ddc2ac50e
parent95c43b2664b57624f363feabe07b44c02bec02d6 (diff)
downloadskiboot-65d5f68fc7f5f00cd9045246e407c85785df2ed6.zip
skiboot-65d5f68fc7f5f00cd9045246e407c85785df2ed6.tar.gz
skiboot-65d5f68fc7f5f00cd9045246e407c85785df2ed6.tar.bz2
cpu: idle move the minimum PM latency into the idle code
The caller isn't in a position to know about PM heuristics, so move the minimum timeout before power managmeent into the cpu idle call. There is no functional change. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--core/cpu.c3
-rw-r--r--core/timebase.c4
-rw-r--r--include/cpu.h2
3 files changed, 4 insertions, 5 deletions
diff --git a/core/cpu.c b/core/cpu.c
index 6f78461..495f7bf 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -402,10 +402,11 @@ void cpu_idle_job(void)
}
}
-void cpu_idle_delay(unsigned long delay, unsigned long min_pm)
+void cpu_idle_delay(unsigned long delay)
{
unsigned long now = mftb();
unsigned long end = now + delay;
+ unsigned long min_pm = usecs_to_tb(10);
if (pm_enabled && delay > min_pm) {
for (;;) {
diff --git a/core/timebase.c b/core/timebase.c
index ca961c3..f2dff44 100644
--- a/core/timebase.c
+++ b/core/timebase.c
@@ -66,14 +66,12 @@ void time_wait(unsigned long duration)
void time_wait_nopoll(unsigned long duration)
{
- unsigned long min_sleep = usecs_to_tb(10);
-
if (this_cpu()->tb_invalid) {
cpu_relax();
return;
}
- cpu_idle_delay(duration, min_sleep);
+ cpu_idle_delay(duration);
}
void time_wait_ms(unsigned long ms)
diff --git a/include/cpu.h b/include/cpu.h
index 1b622a5..77419ca 100644
--- a/include/cpu.h
+++ b/include/cpu.h
@@ -275,7 +275,7 @@ extern unsigned long __attrconst cpu_stack_bottom(unsigned int pir);
extern unsigned long __attrconst cpu_stack_top(unsigned int pir);
extern void cpu_idle_job(void);
-extern void cpu_idle_delay(unsigned long delay, unsigned long min_pm);
+extern void cpu_idle_delay(unsigned long delay);
extern void cpu_set_radix_mode(void);
extern void cpu_fast_reboot_complete(void);