aboutsummaryrefslogtreecommitdiff
path: root/core/cpu.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-09-14 21:13:42 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-09-28 00:30:02 -0500
commit95c43b2664b57624f363feabe07b44c02bec02d6 (patch)
tree175c3f136dbfb9254856764f937e9fccad5fe0ce /core/cpu.c
parent712837cedca06644d2e8dbb12e1cf535fbbd78ba (diff)
downloadskiboot-95c43b2664b57624f363feabe07b44c02bec02d6.zip
skiboot-95c43b2664b57624f363feabe07b44c02bec02d6.tar.gz
skiboot-95c43b2664b57624f363feabe07b44c02bec02d6.tar.bz2
cpu: avoid decrementer wakeups in case of cpu_wake_on_job idle
Rather than setting decrementer to max in the case we want to ignore it, just don't set it as a wakeup reason the in LPCR. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/cpu.c')
-rw-r--r--core/cpu.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/core/cpu.c b/core/cpu.c
index 358356a..6f78461 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -304,17 +304,9 @@ static void cpu_idle_p8(enum cpu_wake_cause wake_on)
return;
}
- /* If we are waking on job, whack DEC to highest value */
- if (wake_on == cpu_wake_on_job)
- mtspr(SPR_DEC, 0x7fffffff);
-
/* Clean up ICP, be ready for IPIs */
icp_prep_for_pm();
- /* Setup wakup cause in LPCR */
- lpcr |= SPR_LPCR_P8_PECE2 | SPR_LPCR_P8_PECE3;
- mtspr(SPR_LPCR, lpcr);
-
/* Synchronize with wakers */
if (wake_on == cpu_wake_on_job) {
/* Mark ourselves in idle so other CPUs know to send an IPI */
@@ -324,6 +316,10 @@ static void cpu_idle_p8(enum cpu_wake_cause wake_on)
/* Check for jobs again */
if (cpu_check_jobs(cpu) || !pm_enabled)
goto skip_sleep;
+
+ lpcr |= SPR_LPCR_P8_PECE2;
+ mtspr(SPR_LPCR, lpcr);
+
} else {
/* Mark outselves sleeping so cpu_set_pm_enable knows to
* send an IPI
@@ -334,6 +330,9 @@ static void cpu_idle_p8(enum cpu_wake_cause wake_on)
/* Check if PM got disabled */
if (!pm_enabled)
goto skip_sleep;
+
+ lpcr |= SPR_LPCR_P8_PECE2 | SPR_LPCR_P8_PECE3;
+ mtspr(SPR_LPCR, lpcr);
}
/* Enter nap */