From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [v3] command/cache: Add flush command
Date: Mon, 8 Apr 2013 14:31:52 -0500 [thread overview]
Message-ID: <1365449512.28843.10@snotra> (raw)
In-Reply-To: <20130408191820.D34632016C2@gemini.denx.de> (from wd@denx.de on Mon Apr 8 14:18:20 2013)
On 04/08/2013 02:18:20 PM, Wolfgang Denk wrote:
> Dear Scott,
>
> In message <1365447916.28843.7@snotra> you wrote:
> >
> > Maybe "cache" should be the toplevel command, with "icache" and
> > "dcache" refactored to be subcommands? Of course, then you're
> making
> > an incompatible interface change. How much is consistency worth?
>
> I think backward compatibility is mandatory here. We cannot break
> existing user scripts.
Sure. But if the main reason for the icache/dcache split is
compatibility, I don't think that should constrict the form of new
commands.
> I'm also not convinced that merging this into one command would be a
> better design. I think the current split is a pretty good represen-
> tation of what the hardware looks like and how i works. Let's keep
> it.
>
> > The whole point of the patch is to expose the existing flush_cache()
> > functionality, which is not split into icache/dcache. From the
> user's
>
> I understand this. But while the combination of IC and DC related
> operations into one function may be convenient for internal use, it is
> not a good idea when exposed externally.
>
> > perspective, it's a command to flush the specified region out of
> *all*
> > caches. It's an implementation detail that some hardware or
>
> I understand what you mean, but actually we do not flush the IC, we
> invalidate it, which is something different. I don't want to start a
> discussion here if flush_cache() is actually a bad function name (when
> discussing the functionality, it is), not do I want to suggest to
> change that name.
>
> But when we publish such interfaces to the end user, it is important
> to be precise in our terminology.
I think the terminology is just fine. It's not just invalidating the
icache (flushing and invalidating are the same thing for cache lines
which are not modified -- or are incapable of being modified). It's
flushing the region out of *all* caches.
What actual use case is there for only wanting to flush one or the
other?
> > architectures accomplish this using separate dcache and icache
> > instructions. If you make the interface be "icache/dcache", how
> would
> > you handle hardware where the flushing mechanism (or even the cache
> > itself) is not split?
>
> If IC and DC are the same thing, the same function can be used to
> implement the operations. "icache" and "dcache" would then run the
> same code, i. e. be aliases.
>
> > > [In the example of L2 cache above, it would be for example
> sufficient
> > > to add a "-L2" option to the "icache" / "dcache" commands.]
> >
> > Would it? On our chips L2 cache is (more or less) unified.
> There's no
> > separate icache/dcache flush.
>
> See above. In such a case "icache" and "dcache" can just call the
> same underlying code.
And then we end up having to do the flush twice, if the user follows
the "first flush dcache, then flush icache" instructions. That's not
an ideal interface.
-Scott
next prev parent reply other threads:[~2013-04-08 19:31 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-05 20:50 [U-Boot] [v3] command/cache: Add flush command York Sun
2013-04-05 21:00 ` Tom Rini
2013-04-05 21:09 ` York Sun
2013-04-05 22:09 ` Wolfgang Denk
2013-04-05 23:02 ` York Sun
2013-04-06 7:01 ` Wolfgang Denk
2013-04-07 3:31 ` sun york-R58495
2013-04-07 8:29 ` Wolfgang Denk
2013-04-08 17:45 ` sun york-R58495
2013-04-08 18:35 ` Wolfgang Denk
2013-04-08 19:05 ` Scott Wood
2013-04-08 19:18 ` Wolfgang Denk
2013-04-08 19:31 ` Scott Wood [this message]
2013-04-09 17:45 ` Wolfgang Denk
2013-04-10 0:58 ` Scott Wood
2013-04-10 2:07 ` [U-Boot] DWMMC / DWMCI question TigerLiu at viatech.com.cn
2013-04-10 11:58 ` Wolfgang Denk
2013-04-11 1:43 ` TigerLiu at viatech.com.cn
2013-04-10 11:54 ` [U-Boot] [v3] command/cache: Add flush command Wolfgang Denk
2013-04-10 19:42 ` Scott Wood
2013-04-10 21:04 ` Wolfgang Denk
2013-04-10 21:10 ` Scott Wood
2013-04-10 22:50 ` Wolfgang Denk
2013-04-10 23:00 ` Scott Wood
2013-04-11 11:56 ` Wolfgang Denk
2013-04-08 19:50 ` Scott Wood
2013-04-09 17:48 ` Wolfgang Denk
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=1365449512.28843.10@snotra \
--to=scottwood@freescale.com \
--cc=u-boot@lists.denx.de \
/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