From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: L1 & L2 cache flush sequence on CortexA5 MPcore w.r.t low power modes
Date: Mon, 14 May 2012 17:39:09 +0100 [thread overview]
Message-ID: <20120514163909.GB13860@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20120514162150.GA4654@e102568-lin.cambridge.arm.com>
On Mon, May 14, 2012 at 05:21:50PM +0100, Lorenzo Pieralisi wrote:
> On Mon, May 14, 2012 at 04:58:59PM +0100, Russell King - ARM Linux wrote:
> > On Mon, May 14, 2012 at 04:50:22PM +0100, Lorenzo Pieralisi wrote:
> > > > 2. L2 disable
> > > > 3. L1 clean & invalidate
> > >
> > > This is wrong again since while cleaning and invalidating the cache (L1 here)
> > > can still allocate and this must not happen.
> >
> > No it isn't. There is never anything wrong with allocating new caches lines
> > into a cache which is going to (eventually) be powered down. Ever.
>
> What if the cache allocates a dirty cache line moved from L1 of another
> processor ?
>
> > What would be wrong is if we end up with dirty cache lines in the cache
> > to be powered down for data which we _care_ about preserving when power
> > is lost.
> >
> > That's a _very_ _very_ important difference.
>
> That's exactly the point I am making. dirty cache lines can be migrated across
> processors caches. If we want to shut down a single core we have to be 100%
> sure that dirty cache lines (if we care about that data, we might be not as you
> pointed out) must not be present in L1 when we shut the core down. If the C
> bit in SCTLR is not cleared before cleaning and invalidating this is not
> guaranteed from an architectural point of view.
>
> Occurences might be rare, but it is still not safe to clean the cache with the
> C bit set.
It's not safe to disable the C bit without first pushing the dirty data out
to RAM either. It's a catch-22 situation - because turning the C bit off
not only stops the caches allocating new lines but also prevents them being
searched.
That means your view of cacheable memory suddenly changes beneath you when
the C bit is turned off.
>From what you're saying - and from my understanding of your cache behaviours,
even the sequence:
- clean cache
- disable C bit
- clean cache
is buggy.
I think what you're effectively saying is that it is not possible to safely
power down a cache on an ARM SMP CPU...
next prev parent reply other threads:[~2012-05-14 16:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-14 7:03 L1 & L2 cache flush sequence on CortexA5 MPcore w.r.t low power modes Murali N
2012-05-14 15:50 ` Lorenzo Pieralisi
2012-05-14 15:58 ` Russell King - ARM Linux
2012-05-14 16:21 ` Lorenzo Pieralisi
2012-05-14 16:39 ` Russell King - ARM Linux [this message]
2012-05-14 17:15 ` Lorenzo Pieralisi
2012-05-15 9:25 ` Murali N
2012-05-15 9:40 ` Russell King - ARM Linux
2012-05-15 10:09 ` Lorenzo Pieralisi
2012-05-15 10:15 ` Russell King - ARM Linux
2012-05-15 16:28 ` Lorenzo Pieralisi
2012-05-15 16:36 ` Russell King - ARM Linux
2012-05-15 17:05 ` Lorenzo Pieralisi
2012-09-19 8:55 ` Antti P Miettinen
2012-09-20 9:54 ` Lorenzo Pieralisi
2012-09-20 21:17 ` Antti P Miettinen
2012-09-23 21:32 ` Antti P Miettinen
2013-02-22 9:04 ` Antti P Miettinen
2013-02-22 9:39 ` Lorenzo Pieralisi
2013-02-23 20:41 ` Antti P Miettinen
2013-02-25 13:36 ` Lorenzo Pieralisi
2012-05-15 18:17 ` Will Deacon
2012-05-17 5:01 ` Murali N
2012-05-17 7:30 ` Shilimkar, Santosh
2013-12-24 17:52 ` Antti Miettinen
2014-01-06 12:43 ` 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=20120514163909.GB13860@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).