linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] arm: ls1: add CPU hotplug platform support
Date: Fri, 26 Sep 2014 13:20:04 +0100	[thread overview]
Message-ID: <20140926122003.GP5182@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1411730703-25836-2-git-send-email-chenhui.zhao@freescale.com>

On Fri, Sep 26, 2014 at 07:25:01PM +0800, Chenhui Zhao wrote:
> +static inline void ls1_do_lowpower(unsigned int cpu, int *spurious)
> +{
> +	/*
> +	 * there is no power-control hardware on this platform, so all
> +	 * we can do is put the core into WFI; this is safe as the calling
> +	 * code will have already disabled interrupts
> +	 */
> +	for (;;) {
> +		wfi();
> +
> +		if (pen_release == cpu_logical_map(cpu)) {
> +			/*OK, proper wakeup, we're done*/
> +			break;
> +		}
> +
> +		/*
> +		 * Getting here, means that we have come out of WFI without
> +		 * having been woken up - this shouldn't happen
> +		 *
> +		 * Just note it happening - when we're woken, we can report
> +		 * its occurrence.
> +		 */
> +		(*spurious)++;
> +	}
> +}

This is pretty much unacceptable - this breaks kexec(), and suspend
support because your secondary CPUs aren't really sleeping, they're
sitting in a loop doing nothing.

In the kexec case, the code which the secondary CPU is executing can
be overwritten, which then means that the CPU ends up executing some
random code instead.

Do you really have no way to properly power down or reset the CPU
being unplugged?  If you don't, that's a *huge* oversight in this
modern age, and it means that you're pretty much stuck with having
these features disabled.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2014-09-26 12:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-26 11:25 [PATCH 0/3] arm: ls1: add deep sleep support Chenhui Zhao
2014-09-26 11:25 ` [PATCH 1/3] arm: ls1: add CPU hotplug platform support Chenhui Zhao
2014-09-26 12:20   ` Russell King - ARM Linux [this message]
2014-09-26 12:46     ` Mark Rutland
2014-09-26 13:03       ` Russell King - ARM Linux
2014-09-26 13:20         ` Mark Rutland
2014-09-28 10:57           ` Li Yang
2014-09-28 14:27             ` Russell King - ARM Linux
2014-09-26 11:25 ` [PATCH 2/3] pm: add FSM configuration for deep sleep Chenhui Zhao
2014-09-26 12:02   ` Russell King - ARM Linux
2014-09-26 20:51     ` Russell King - ARM Linux
2014-09-28  9:53       ` Chenhui Zhao
2014-09-26 11:25 ` [PATCH 3/3] arm: pm: add deep sleep support for LS1 Chenhui Zhao
2014-09-26 12:14   ` Russell King - ARM Linux
2014-09-28 11:06     ` Chenhui Zhao
2014-09-28 14:26       ` Russell King - ARM Linux
2014-09-29  9:42         ` Chenhui Zhao

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=20140926122003.GP5182@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;
as well as URLs for NNTP newsgroup(s).