From: "Joakim Tjernlund" <joakim.tjernlund@lumentis.se>
To: "'Segher Boessenkool'" <segher@koffie.nl>
Cc: "'Paul Mackerras'" <paulus@samba.org>,
<linuxppc-embedded@lists.linuxppc.org>
Subject: SV: SV: New invalidate/clean/flush_dcache functions
Date: Fri, 27 Dec 2002 21:20:04 +0100 [thread overview]
Message-ID: <000001c2ade5$5baaa020$94b9143e@hempc> (raw)
In-Reply-To: <3E0BA5BB.7B959E63@koffie.nl>
> Joakim Tjernlund wrote:
>
> > Only the invalidate function is missing the sync instruction.
> > It's not needed. Invalidating the cache does not touch the memory
> > so there is no need to sync the memory. I have been running my
system
>
> sync is not a "sync the memory" instruction, whatever that should
mean.
> >From chapter 8 of the 32-bit PEM:
>
> The sync instruction provides an ordering function for the
> effects of
> all instructions executed by a given processor. Executing a
> sync
> instruction ensures that all instructions preceding the sync
> instruction
> appear to have completed before the sync instruction completes,
> and that
> no subsequent instructions are initiated by the processor until
> after the
> sync instruction completes. When the sync instruction
> completes, all
> external accesses caused by instructions preceding the sync
> instruction
> will have been performed with respect to all other mechanisms
> that access
> memory.
>
> dcbi can cause external accesses (it invalidates cache on _all_ cpu's
in a
> system, not just the local cpu).
OK thanks.
>
> > without it for a long time and I asked my HW contact at Motorola
about
> > it and he agreed. Others has used the dcbi without a sync without
> > problems.
> >
> > Can you give me a pointer to where the spec claims that a sync is
> > needed after a dcbi?
>
> It doesn't. Whether the sync is needed or not depends on your usage
of
> the
> dcbi, i.e. 1) is it necessary that the cache line gets invalidated on
all
> other cpu's, too? and 2) do you already have another sync instruction
on
> this
> cpu, some time after the dcbi, but before the point where you have the
> requirement
> of invalidation?
In my typical example I need to invalidate a buffer before I give it to
the
CPM to be used as a receive buffer. Once given to the CPM there must be
no more writes to that buffer memory. When the CPM has received data
and written the data into the buffer and hands it over to the CPU
(usally via an interrupt) the next read from the CPU must access it from
the memory. Does the above require a sync?
Does it take some time before a invalidate is completed?
Jocke
>
> It might very well be true that a sync here isn't necessary, and
sync's
> can be very
> costly (on smp systems), but better be safe than sorry.
>
>
> Cheers,
>
> Segher
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2002-12-27 20:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-20 16:21 E1/T1 on mpc8260 Omanakuttan
2002-12-20 17:46 ` New invalidate/clean/flush_dcache functions Joakim Tjernlund
2002-12-21 14:25 ` Joakim Tjernlund
2002-12-22 7:00 ` Paul Mackerras
2002-12-23 13:19 ` SV: " Joakim Tjernlund
2002-12-26 4:12 ` Paul Mackerras
2002-12-26 13:52 ` SV: " Joakim Tjernlund
2004-04-26 16:41 ` High resolution timer in driver bhupinder sahran
2004-04-26 18:06 ` Wolfgang Denk
2004-04-27 15:52 ` bhupinder sahran
2002-12-27 0:58 ` SV: New invalidate/clean/flush_dcache functions Segher Boessenkool
2002-12-27 20:20 ` Joakim Tjernlund [this message]
2002-12-28 4:01 ` SV: " Segher Boessenkool
2002-12-23 20:26 ` Dan Malek
2002-12-24 10:36 ` SV: " Joakim Tjernlund
2002-12-24 17:53 ` Dan Malek
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='000001c2ade5$5baaa020$94b9143e@hempc' \
--to=joakim.tjernlund@lumentis.se \
--cc=linuxppc-embedded@lists.linuxppc.org \
--cc=paulus@samba.org \
--cc=segher@koffie.nl \
/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).