From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] ARM Generic Timer + Interaction with WFI on Cortex-A15
Date: Thu, 21 Nov 2013 12:00:25 +0000 [thread overview]
Message-ID: <20131121120025.GC31695@e102568-lin.cambridge.arm.com> (raw)
In-Reply-To: <528DBD0C.6040203@gmail.com>
On Thu, Nov 21, 2013 at 07:58:04AM +0000, Marc C wrote:
> Hello,
>
> I have a question regarding the interaction with the ARM Generic (or
> architected) timer, high-resolution timer support, and the WFI instruction.
>
> This commit [1] sets up the "C3STOP" flag on the arch_timer. According
> to the commit log, an ARM core which implements the ARM Generic Timer
> may power-down and thus invalidate some registers within the timer.
> Therefore, flagging the timer with C3STOP will ensure that an
> appropriate broadcast timer will be used whenever the CPU goes into idle.
>
> However, according to this article [2], there is a difference in
> implementation between the Cortex-A7 and Cortex-A15, wherein the A7 will
> power-down on idle, and the A15 will not.
There is a difference in implementation, which implies that A15 local
timers might still be running when a CPU is power gated since the
local timer voltage domain is different from the vcpu, voltage to the core.
It is an A15 oddity. On A7 and newer cores, the local timer will be
held in reset/power down when a single core is shutdown.
See, point is, even if on A15 the timer is still running when a single
core is shutdown, this might not be true when the A15 cluster goes down.
At that point in time, when the last CPU running in a cluster is about
to call a cluster shutdown, how can you offload the local timer of _another_
CPU to an always-on timer acting as broadcast ? Wake up that CPU up just
to enter broadcast mode ? This is not really power efficient and we add
complexity in the kernel. There might be a way to solve this by using
the clock event API but I would rule it out.
It is basically the same reason why we save/restore the GIC CPU IF
configuration whenever a single core goes down (but the GIC stays on),
because there is no way to read it from other CPUs when the GIC is shutdown
for good (NB this is just an example and is likely to change with future GIC
implementations).
Since it is an A15 oddity, I think we should not care and keep things as
they are in the kernel.
> Now, given the 2 citations, can someone explain why the C3STOP flag is
> used for _all_ implementations? Is it not the case that the A15-based
> arch_timer can be used as a broadcast timer, even if the kernel is
> configured to call WFI and put the CPU into low-power mode?
>
> There have been some recent commits which conditionally setup the C3STOP
> flag, depending on the CONFIG_CPU_IDLE flag. However, my concern is that
> there are some ARM implementations that can actually go into low-power
> mode and still use the arch_timer reliably.
It is an A15 oddity and we should not care, given that this behaviour is
platform specific and likely to fail in most common A15 implementations.
Thank you for pointing that out though.
Lorenzo
next prev parent reply other threads:[~2013-11-21 12:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-21 7:58 [RFC] ARM Generic Timer + Interaction with WFI on Cortex-A15 Marc C
2013-11-21 12:00 ` Lorenzo Pieralisi [this message]
2013-11-26 6:42 ` Marc C
2013-11-26 10:10 ` Lorenzo Pieralisi
2013-11-26 11:03 ` Marc C
2013-11-26 12:28 ` Lorenzo Pieralisi
2013-11-26 15:18 ` Santosh Shilimkar
2014-01-30 16:19 ` Lorenzo Pieralisi
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=20131121120025.GC31695@e102568-lin.cambridge.arm.com \
--to=lorenzo.pieralisi@arm.com \
--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).