From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: Chen-Yu Tsai <wens@csie.org>
Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: Use WFI when possible when halting a core
Date: Thu, 27 Jul 2017 13:17:20 +0100 [thread overview]
Message-ID: <20170727121720.GS31807@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20170727120803.27848-1-wens@csie.org>
On Thu, Jul 27, 2017 at 08:08:03PM +0800, Chen-Yu Tsai wrote:
> On ARM, the kernel busy loops after cleaning up when a core is to be
> halted. This may have the undesired effect of increasing the core
> temperature, at a time when no power or thermal management is
> available, such as a kernel panic or shutdown to halt.
>
> x86 uses the more efficient HLT (halt) instruction. The equivalent
> instruction on ARM is WFI (wait for interrupt).
>
> This patch makes the busy loops in the ARM halt/reboot/panic paths
> use WFI when available (as defined in arch/arm/include/asm/barrier.h).
>
> A touch test indicates that this lowers the surface temperature of the
> Allwinner H3 SoC, with all 4 cores brought up with SMP, from painfully
> hot to just warm to the touch after shutdown to halt.
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>
> I asked about this some time ago, and the answer was no one had done
> it. So here it is. It is somewhat similar to the patch "arm64:
> Improve parking of stopped CPUs", for arm64 obviously.
There are various errata around the "wfi" instruction on various CPUs
which means that this simple implementation isn't going to work
reliably.
This is where cpu_do_idle() comes in - please use that instead.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2017-07-27 12:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-27 12:08 Chen-Yu Tsai
2017-07-27 12:17 ` Russell King - ARM Linux [this message]
2017-07-27 12:45 ` Chen-Yu Tsai
2017-07-28 6:58 ` Chen-Yu Tsai
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=20170727121720.GS31807@n2100.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wens@csie.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
all inboxes | Powered by JetHome®