@@ -375,8 +375,6 @@ static void cpu_idle_p9(enum cpu_wake_cause wake_on)
return;
}
- msgclr(); /* flush pending messages */
-
/* Synchronize with wakers */
if (wake_on == cpu_wake_on_job) {
/* Mark ourselves in idle so other CPUs know to send an IPI */
@@ -420,11 +418,14 @@ static void cpu_idle_p9(enum cpu_wake_cause wake_on)
enter_p9_pm_lite_state(psscr);
}
-skip_sleep:
+ /* Clear doorbell */
+ p9_dbell_receive();
+
+ skip_sleep:
/* Restore */
+ sync();
cpu->in_idle = false;
cpu->in_sleep = false;
- p9_dbell_receive();
}
static void cpu_idle_pm(enum cpu_wake_cause wake_on)
We currently do a rather pointless msgclr prior to setting in_sleep/in_idle (with no ordering guarantee which isn't great). We also do the final msgsync/msgclr after setting in_sleep/in_idle back to false which while probably ok, isn't that great, we should do msgsync first thing when waking up. Finally, do p9_dbell_receive() before skip_sleep. So take out the first msgclr, swap the final p9_dbell_receive() and add a sync() for good measure and match what p8 does. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> --- core/cpu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)