From patchwork Fri May 11 06:41:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 911795 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40j0rK710mz9s0w for ; Fri, 11 May 2018 16:42:09 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40j0rK4x4zzF2D9 for ; Fri, 11 May 2018 16:42:09 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=permerror (mailfrom) smtp.mailfrom=kernel.crashing.org (client-ip=63.228.1.57; helo=gate.crashing.org; envelope-from=benh@kernel.crashing.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40j0rD0qnFzF2Cj for ; Fri, 11 May 2018 16:42:03 +1000 (AEST) Received: from pasglop.au.ibm.com (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w4B6fdkM025593; Fri, 11 May 2018 01:41:42 -0500 From: Benjamin Herrenschmidt To: skiboot@lists.ozlabs.org Date: Fri, 11 May 2018 16:41:20 +1000 Message-Id: <20180511064121.18122-2-benh@kernel.crashing.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180511064121.18122-1-benh@kernel.crashing.org> References: <20180511064121.18122-1-benh@kernel.crashing.org> Subject: [Skiboot] [PATCH 2/3] cpu: Do an isync after setting LPCR X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" This is required by the architecture and the implementations, I've observed failures to wake up on big cores without this. Signed-off-by: Benjamin Herrenschmidt --- core/cpu.c | 3 +++ core/fast-reboot.c | 1 + hw/slw.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/core/cpu.c b/core/cpu.c index 0a1d58f2..3e5e5922 100644 --- a/core/cpu.c +++ b/core/cpu.c @@ -351,6 +351,7 @@ static void cpu_idle_p8(enum cpu_wake_cause wake_on) lpcr |= SPR_LPCR_P8_PECE2 | SPR_LPCR_P8_PECE3; mtspr(SPR_LPCR, lpcr); } + isync(); /* Enter nap */ enter_p8_pm_state(false); @@ -404,6 +405,7 @@ static void cpu_idle_p9(enum cpu_wake_cause wake_on) } mtspr(SPR_LPCR, lpcr); + isync(); if (sreset_enabled) { /* stop with EC=1 (sreset) and ESL=1 (enable thread switch). */ @@ -984,6 +986,7 @@ static void enable_large_dec(bool on) lpcr &= ~SPR_LPCR_P9_LD; mtspr(SPR_LPCR, lpcr); + isync(); } #define HIGH_BIT (1ull << 63) diff --git a/core/fast-reboot.c b/core/fast-reboot.c index a09efd85..3022fdd7 100644 --- a/core/fast-reboot.c +++ b/core/fast-reboot.c @@ -239,6 +239,7 @@ static void check_split_core(void) /* Setup LPCR to wakeup on external interrupts only */ mtspr(SPR_LPCR, ((mfspr(SPR_LPCR) & ~SPR_LPCR_P8_PECE) | SPR_LPCR_P8_PECE2)); + isync(); /* Go to nap (doesn't return) */ enter_nap(); } diff --git a/hw/slw.c b/hw/slw.c index 2b305db1..a5e1e902 100644 --- a/hw/slw.c +++ b/hw/slw.c @@ -73,6 +73,7 @@ static void slw_do_rvwinkle(void *data) /* Setup LPCR to wakeup on external interrupts only */ mtspr(SPR_LPCR, ((lpcr & ~SPR_LPCR_P8_PECE) | SPR_LPCR_P8_PECE2)); + isync(); prlog(PR_DEBUG, "SLW: CPU PIR 0x%04x goint to rvwinkle...\n", cpu->pir); @@ -99,6 +100,7 @@ static void slw_do_rvwinkle(void *data) /* Restore LPCR */ mtspr(SPR_LPCR, lpcr); + isync(); /* If we are passed a master pointer we are the designated * waker, let's proceed. If not, return, we are finished.