Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx: disable cpu in .cpu_kill hook
Date: Mon, 14 Jan 2013 13:32:08 +0000	[thread overview]
Message-ID: <20130114133208.GC23505@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1358168977-9631-1-git-send-email-shawn.guo@linaro.org>

On Mon, Jan 14, 2013 at 09:09:37PM +0800, Shawn Guo wrote:
>  void imx_cpu_die(unsigned int cpu)
>  {
> +	static int spurious;
> +
>  	cpu_enter_lowpower();
> -	imx_enable_cpu(cpu, false);
> +	cpu_do_idle();
> +	cpu_leave_lowpower();
>  
> -	/* spin here until hardware takes it down */
> -	while (1)
> -		;
> +	pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, ++spurious);

Returning from the platform cpu die implementation should only be done
in extreme situations, particularly where there's no possibility for the
CPU to actually be taken offline (in other words, the ARM development
platforms where there is _no_ possibility of powering down or resetting
the secondary CPUs individually.)

I'm actually thinking about supplementing cpu_die() in arch/arm/kernel/smp.c
with a warning:

@@ -259,6 +259,9 @@ void __ref cpu_die(void)
         */
        platform_cpu_die(cpu);

+       pr_warn("CPU%u: platform cpu_die() returned, trying to resuscitate\n",
+               cpu);
+

so that people get warned of this buggy behaviour.

  reply	other threads:[~2013-01-14 13:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-14 13:09 [PATCH] ARM: imx: disable cpu in .cpu_kill hook Shawn Guo
2013-01-14 13:32 ` Russell King - ARM Linux [this message]
2013-01-14 13:48   ` Shawn Guo
2013-01-14 13:55 ` Rob Herring
2013-01-14 14:00   ` Shawn Guo
2013-01-14 16:29   ` Nicolas Pitre
2013-01-14 16:46     ` Russell King - ARM Linux
2013-01-14 16:57       ` Nicolas Pitre

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=20130114133208.GC23505@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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