Return-Path: Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3vjFx92774zDsF8 for ; Wed, 15 Mar 2017 00:30:53 +1100 (AEDT) Received: by mail-pg0-x242.google.com with SMTP id 77so24490676pgc.0 for ; Tue, 14 Mar 2017 06:30:53 -0700 (PDT) Date: Tue, 14 Mar 2017 23:30:29 +1000 From: Nicholas Piggin To: "Gautham R. Shenoy" Cc: Michael Ellerman , Michael Neuling , Benjamin Herrenschmidt , "Shreyas B. Prabhu" , Shilpasri G Bhat , Vaidyanathan Srinivasan , Anton Blanchard , Balbir Singh , Akshay Adiga , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] powernv:smp: Add busy-wait loop as fall back for CPU-Hotplug Message-ID: <20170314233029.478a7294@roar.ozlabs.ibm.com> In-Reply-To: <8c52750bfcd2a7c65673fc82763df7a7f335c79c.1489383815.git.ego@linux.vnet.ibm.com> References: <8c52750bfcd2a7c65673fc82763df7a7f335c79c.1489383815.git.ego@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, 13 Mar 2017 11:31:26 +0530 "Gautham R. Shenoy" wrote: > [Changelog written with inputs from svaidy@linux.vnet.ibm.com] > Signed-off-by: Gautham R. Shenoy Reviewed-by: Nicholas Piggin > --- > arch/powerpc/platforms/powernv/smp.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c > index e39e6c4..8d5b99e 100644 > --- a/arch/powerpc/platforms/powernv/smp.c > +++ b/arch/powerpc/platforms/powernv/smp.c > @@ -192,8 +192,16 @@ static void pnv_smp_cpu_kill_self(void) > } else if ((idle_states & OPAL_PM_SLEEP_ENABLED) || > (idle_states & OPAL_PM_SLEEP_ENABLED_ER1)) { > srr1 = power7_sleep(); > - } else { > + } else if (idle_states & OPAL_PM_NAP_ENABLED) { > srr1 = power7_nap(1); > + } else { > + /* This is the fallback method. We emulate snooze */ > + while (!generic_check_cpu_restart(cpu)) { > + HMT_low(); > + HMT_very_low(); > + } > + srr1 = 0; > + HMT_medium(); > } > > ppc64_runlatch_on();