linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: Nicholas Piggin <npiggin@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Scott Wood <oss@buserror.net>,
	Alessio Igor Bogani <alessio.bogani@elettra.eu>,
	Paul Mackerras <paulus@samba.org>, Daniel Axtens <dja@axtens.net>
Subject: Re: [PATCH v2 1/3] powerpc: Factor out common code in setup-common.c
Date: Tue, 9 Aug 2016 09:30:54 -0700	[thread overview]
Message-ID: <CAHQ1cqH650Ef9mdoKiWvy4ubz=sx32bDjgQ9sYQRRve+q8rKMQ@mail.gmail.com> (raw)
In-Reply-To: <20160801134031.7dcb7c82@roar.ozlabs.ibm.com>

On Sun, Jul 31, 2016 at 8:40 PM, Nicholas Piggin <npiggin@gmail.com> wrote:
> On Thu, 28 Jul 2016 16:07:16 -0700
> Andrey Smirnov <andrew.smirnov@gmail.com> wrote:
>
>> Factor out a small bit of common code in machine_restart(),
>> machine_power_off() and machine_halt().
>>
>> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
>> ---
>>
>> 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.

Thanks,
Andrey

  reply	other threads:[~2016-08-09 16:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28 23:07 [PATCH v2 1/3] powerpc: Factor out common code in setup-common.c Andrey Smirnov
2016-07-28 23:07 ` [PATCH v2 2/3] powerpc: Call chained reset handlers during reset Andrey Smirnov
2016-08-01  3:47   ` Nicholas Piggin
2016-08-09 18:27     ` Andrey Smirnov
2016-07-28 23:07 ` [PATCH v2 3/3] powerpc: Convert fsl_rstcr_restart to a reset handler Andrey Smirnov
2016-08-01  4:03   ` Nicholas Piggin
2016-08-09 18:47     ` Andrey Smirnov
2016-08-10  0:58       ` Nicholas Piggin
2016-08-01  3:40 ` [PATCH v2 1/3] powerpc: Factor out common code in setup-common.c Nicholas Piggin
2016-08-09 16:30   ` Andrey Smirnov [this message]
2016-08-10  0:54     ` Nicholas Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHQ1cqH650Ef9mdoKiWvy4ubz=sx32bDjgQ9sYQRRve+q8rKMQ@mail.gmail.com' \
    --to=andrew.smirnov@gmail.com \
    --cc=alessio.bogani@elettra.eu \
    --cc=dja@axtens.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    --cc=oss@buserror.net \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).