From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752647AbcHJAyR (ORCPT ); Tue, 9 Aug 2016 20:54:17 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:34633 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752557AbcHJAyP (ORCPT ); Tue, 9 Aug 2016 20:54:15 -0400 Date: Wed, 10 Aug 2016 10:54:07 +1000 From: Nicholas Piggin To: Andrey Smirnov Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Scott Wood , Alessio Igor Bogani , Paul Mackerras , Daniel Axtens Subject: Re: [PATCH v2 1/3] powerpc: Factor out common code in setup-common.c Message-ID: <20160810105407.47cf4148@roar.ozlabs.ibm.com> In-Reply-To: References: <1469747238-17432-1-git-send-email-andrew.smirnov@gmail.com> <20160801134031.7dcb7c82@roar.ozlabs.ibm.com> Organization: IBM X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 9 Aug 2016 09:30:54 -0700 Andrey Smirnov wrote: > On Sun, Jul 31, 2016 at 8:40 PM, Nicholas Piggin wrote: > > On Thu, 28 Jul 2016 16:07:16 -0700 > > Andrey Smirnov wrote: > > > >> Factor out a small bit of common code in machine_restart(), > >> machine_power_off() and machine_halt(). > >> > >> Signed-off-by: Andrey Smirnov > >> --- > >> > >> No changes compared to v1. > >> > >> arch/powerpc/kernel/setup-common.c | 23 ++++++++++++++--------- > >> 1 file changed, 14 insertions(+), 9 deletions(-) > >> > >> diff --git a/arch/powerpc/kernel/setup-common.c > >> b/arch/powerpc/kernel/setup-common.c index 714b4ba..5cd3283 100644 > >> --- a/arch/powerpc/kernel/setup-common.c > >> +++ b/arch/powerpc/kernel/setup-common.c > >> @@ -130,15 +130,22 @@ void machine_shutdown(void) > >> ppc_md.machine_shutdown(); > >> } > >> > >> +static void machine_hang(void) > >> +{ > >> + pr_emerg("System Halted, OK to turn off power\n"); > >> + local_irq_disable(); > >> + while (1) > >> + ; > >> +} > > > > What's the intended semantics of this function? A default power > > off handler when the platform supplies none? > > I was mostly trying to avoid code duplication in > machine_halt/machine_restart/machine_power_off and didn't intend that > function to be used outside. The semantics is just - to hang the CPU > when things didn't go as expected and code that was supposed to > restart/halt/power off the machine failed. > > > Would ppc_power_off() > > be a good name? > > Calling it "power_off" seems a bit misleading, the function doesn't > really try to do anything related to powering off, really. Okay I don't feel too strongly against it. Thanks, Nick