linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <bh40@calva.net>
To: linuxppc-dev@lists.linuxppc.org
Cc: Paul Mackerras <paulus@cs.anu.edu.au>
Subject: Thoughts about DBDMA and cache coherency
Date: Fri, 19 Mar 1999 00:16:14 +0100	[thread overview]
Message-ID: <19990319001614.001351@mail.mipsys.com> (raw)


Hi all !

I'm sure I'm wrong but I would like someone to point me to my error:

It appears that Apple's Darwin drivers use to flushe the cache of the
memory occupied by a DBDMA descriptor bloc before using it. This would
mean that the memory is not cache coherent when seen from the PCI bus,
and when you think about it, it looks logical: Writes issued from the PCI
to memory are coherent since snooped by the CPU and will force it to
reload the cache (I'm thinking about the 750 with backside cache, but
this may apply to other implementations depending on the bridge), but
when a device reads a piece of memory, i don't see the bridge asking the
CPU to flush this cache range before the read completes. I didn't see any
setting in Grackle to force this and in the case of the G3, the cache is
not handled by the bridge anyway but by the CPU itself...

That would mean that we need to flush the range occupied by DBDMA
descriptors, but also any buffers used by DBDMA when outputing via a
DBDMA channel.

Under MacOS, we use an OS function called PrepareMemoryForIO that will
take care of making pages resident, do appropriate cache flushing and
returns physical page tables for ranges of system memory. We can also,
for small buffers, use LockMemoryContiguous which will ... disable
caching for the selected pages.

Either I missed something big, either linux fails to do so and may have
unreliable writes to DBDMA devices all the time (looks like it would
crash a lot more often than it does, I must be wrong somewhere).

Someone has the solution ?

-- 
           E-Mail: <mailto:bh40@calva.net>
BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>





[[ This message was sent via the linuxppc-dev mailing list.  Replies are ]]
[[ not  forced  back  to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting.   ]]

             reply	other threads:[~1999-03-18 23:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-18 23:16 Benjamin Herrenschmidt [this message]
1999-03-18 23:31 ` Thoughts about DBDMA and cache coherency Paul Mackerras
1999-03-18 23:41   ` Benjamin Herrenschmidt
1999-03-20 17:02   ` egcs 1.1.2 big improvement over egcs 1.1.1 ! Kevin B. Hendricks
1999-03-22 17:59     ` Franz Sirl
1999-03-22 19:38       ` smbfs and smbmount and Paul's 2.2.1 kernel Kevin B. Hendricks
1999-03-23 12:27         ` Benjamin Herrenschmidt

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=19990319001614.001351@mail.mipsys.com \
    --to=bh40@calva.net \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=paulus@cs.anu.edu.au \
    /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).