All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Russell King <linux@arm.linux.org.uk>,
	Will Deacon <will.deacon@arm.com>,
	kexec@lists.infradead.org, Eric Biederman <ebiederm@xmission.com>,
	Stephen Warren <swarren@nvidia.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: call disable_nonboot_cpus() from machine_shutdown()
Date: Wed, 02 Jan 2013 15:59:02 -0800	[thread overview]
Message-ID: <50E4C9C6.20609@codeaurora.org> (raw)
In-Reply-To: <1357160861-26282-1-git-send-email-swarren@wwwdotorg.org>

On 01/02/13 13:07, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> On Tegra at least, this change allows kexec to work with SMP enabled.
> Without this,  machine_shutdown() simply puts all CPUs into a loop. If
> the code of that loop is over-written, the CPUs may hang or crash (which
> I do observe in practice), or cause the kexec'd kernel not to be able to
> initialize them.
>
> This fix has the added benefit that the kexec always happens on the boot
> CPU, and thus kexec mirrors the initial kernel boot as much as possible.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> Russell, I assume this should go into the ARM patch tracker if OK?
>
>  arch/arm/kernel/process.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
> index f79dd1e..1893bda 100644
> --- a/arch/arm/kernel/process.c
> +++ b/arch/arm/kernel/process.c
> @@ -239,6 +239,7 @@ __setup("reboot=", reboot_setup);
>  
>  void machine_shutdown(void)
>  {
> +	disable_nonboot_cpus();
>  #ifdef CONFIG_SMP
>  	smp_send_stop();
>  #endif

How does this work in a CONFIG_SUSPEND=n build? It looks like
disable_nonboot_cpus() would be a no-op and so we wouldn't actually hot
unplug the other CPUs before sending the smp_send_stop(). And then the
smp_send_stop() seems a little unnecessary if we do actually shutdown
the other CPUs.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: call disable_nonboot_cpus() from machine_shutdown()
Date: Wed, 02 Jan 2013 15:59:02 -0800	[thread overview]
Message-ID: <50E4C9C6.20609@codeaurora.org> (raw)
In-Reply-To: <1357160861-26282-1-git-send-email-swarren@wwwdotorg.org>

On 01/02/13 13:07, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> On Tegra at least, this change allows kexec to work with SMP enabled.
> Without this,  machine_shutdown() simply puts all CPUs into a loop. If
> the code of that loop is over-written, the CPUs may hang or crash (which
> I do observe in practice), or cause the kexec'd kernel not to be able to
> initialize them.
>
> This fix has the added benefit that the kexec always happens on the boot
> CPU, and thus kexec mirrors the initial kernel boot as much as possible.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> Russell, I assume this should go into the ARM patch tracker if OK?
>
>  arch/arm/kernel/process.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
> index f79dd1e..1893bda 100644
> --- a/arch/arm/kernel/process.c
> +++ b/arch/arm/kernel/process.c
> @@ -239,6 +239,7 @@ __setup("reboot=", reboot_setup);
>  
>  void machine_shutdown(void)
>  {
> +	disable_nonboot_cpus();
>  #ifdef CONFIG_SMP
>  	smp_send_stop();
>  #endif

How does this work in a CONFIG_SUSPEND=n build? It looks like
disable_nonboot_cpus() would be a no-op and so we wouldn't actually hot
unplug the other CPUs before sending the smp_send_stop(). And then the
smp_send_stop() seems a little unnecessary if we do actually shutdown
the other CPUs.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

  parent reply	other threads:[~2013-01-02 23:59 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-02 21:07 [PATCH] ARM: call disable_nonboot_cpus() from machine_shutdown() Stephen Warren
2013-01-02 21:07 ` Stephen Warren
2013-01-02 21:52 ` Russell King - ARM Linux
2013-01-02 21:52   ` Russell King - ARM Linux
2013-01-02 23:59 ` Stephen Boyd [this message]
2013-01-02 23:59   ` Stephen Boyd
2013-01-03 12:02   ` Will Deacon
2013-01-03 12:02     ` Will Deacon
2013-01-03 12:21     ` Russell King - ARM Linux
2013-01-03 12:21       ` Russell King - ARM Linux
2013-01-03 18:08       ` Jason Gunthorpe
2013-01-03 18:08         ` Jason Gunthorpe
2013-01-03 20:26       ` Stephen Warren
2013-01-03 20:26         ` Stephen Warren
2013-01-06 16:22         ` Will Deacon
2013-01-06 16:22           ` Will Deacon
2013-01-06 16:40           ` Russell King - ARM Linux
2013-01-06 16:40             ` Russell King - ARM Linux
2013-01-07  1:53             ` Eric W. Biederman
2013-01-07  1:53               ` Eric W. Biederman
2013-01-07 14:25               ` Will Deacon
2013-01-07 14:25                 ` Will Deacon
2013-01-07 14:48               ` Russell King - ARM Linux
2013-01-07 14:48                 ` Russell King - ARM Linux
2013-01-11  5:59                 ` Eric W. Biederman
2013-01-11  5:59                   ` Eric W. Biederman
2013-01-11 10:04                   ` Russell King - ARM Linux
2013-01-11 10:04                     ` Russell King - ARM Linux
2013-01-29 22:01                   ` Stephen Warren
2013-01-29 22:01                     ` Stephen Warren
2013-01-29 22:01                     ` Stephen Warren
2013-01-09  0:06               ` Stephen Warren
2013-01-09  0:06                 ` Stephen Warren
2013-01-11  6:28                 ` Eric W. Biederman
2013-01-11  6:28                   ` Eric W. Biederman
2013-01-29 22:10                   ` Stephen Warren
2013-01-29 22:10                     ` Stephen Warren
2013-01-29 22:10                     ` Stephen Warren
2013-01-03 12:03 ` Will Deacon
2013-01-03 12:03   ` Will Deacon

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=50E4C9C6.20609@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=ebiederm@xmission.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    --cc=swarren@nvidia.com \
    --cc=swarren@wwwdotorg.org \
    --cc=will.deacon@arm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.