Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Jun 2003 01:52:27 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        John-Mark Gurney <gurney_j@efn.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: API change for bus_dma
Message-ID:  <3EFD574B.9419EE71@mindspring.com>
References:  <3EF3C12F.9060303@btc.adaptec.com> <16124.39930.142492.356163@grasshopper.cs.duke.edu> <3EFC9F2D.6020908@btc.adaptec.com> <16124.43999.333761.397624@grasshopper.cs.duke.edu> <3EFCAC7A.6060305@btc.adaptec.com> <16124.45051.919899.414795@grasshopper.cs.duke.edu> <16124.46454.595892.860118@grasshopper.cs.duke.edu> <3EFD492A.60C18556@mindspring.com> <20030628080448.GI55920@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
John-Mark Gurney wrote:
> I'm sorry, no, this will not solve the problem he is talking about.
> You need to reread the information that Andrew has provided before.
> In a previous email you got confused on the STREAMING/COHERENT flag's
> meaning.  Using contigmalloc only gives you a linear address space,
> but does not guarantee that the processor will snoop the memory write
> cycles by the bridge or device to keep the cache of the cpu the same
> with the memory.  For what Andrew needs, he needs the processor to have
> the same information as in memory.  On multiprocessor systems, it can
> get expensive if every processor has to snoop every memory write that
> happens.

Clearly, I don't have a deep understanding of SPARC64 SMP hardware;
given what he was saying, it still looks to me that the issue he
was attempting to address was related to whether or not the memory
in question was physically vs. logically contiguous:

<http://docs.freebsd.org/cgi/getmsg.cgi?fetch=153914+0+current/freebsd-arch>;

It also still looks to me that the use of "cache coherent" in:

<http://docs.freebsd.org/cgi/getmsg.cgi?fetch=138580+0+current/freebsd-arch>;

was referring to user space memory and device memory, and not the
processor cache.  Reading the Solaris ddi_dma_sync(9) man page:

<http://www.FreeBSD.org/cgi/man.cgi?query=ddi_dma_sync&apropos=0&sektion=0&manpath=SunOS+5.9&format=html>;

Doesn't change that impression for me (it mentions that explicitly
calling the function may result in cache flushes, but doesn't imply
snooping will occur).

There's a good programming article on "Writing Device Drivers" in
the "Sun Product Documentation" online:

<http://docs.sun.com/db/doc/802-5900/6i9kj7oq6?a=view>;

That discusses this in detail, and which seems (to me) to be
authoritative.

I'd be happy to be corrected, but if you're going to correct me,
please tell me *why* I'm wrong, instead of just telling me *that*
I'm wrong, since I really *am* interested in not being wrong for
the same root cause in the future.

Thanks,
-- Terry



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EFD574B.9419EE71>