Re: DMA questions (invalidate_dcache and flush_dcache)
Re: DMA questions (invalidate_dcache and flush_dcache)
- Subject: Re: DMA questions (invalidate_dcache and flush_dcache)
- From: Benjamin Herrenschmidt <email@hidden>
- Date: Fri, 12 Sep 2003 17:12:53 +0200
On Monday, September 8, 2003, at 10:19 PM, Ryan Rempel wrote:
I'm updating a driver for the new memory mapping limitations, and I've
got a couple of DMA-related questions.
The driver uses a couple of functions in <osfmk/ppc/pmap.h>, namely:
extern void invalidate_dcache(vm_offset_t va, unsigned length,
boolean_t phys);
extern void flush_dcache(vm_offset_t va, unsigned length, boolean_t
phys);
The calls to invalidate_dcache are accompanied by this comment "Purge
cache references for the DBDMA entry we are about to look at".
The calls to flush_dcache are accompanied by this comnment "Push DMA
commands to physical memory".
Do you actually need to do that at all ? What driver is this ?
Those machines are supposed to be cache coherent...
I know there seem to be cache coherency bugs with earlier hardware,
though I couldn't get any useful
detail from Apple, I had some weird problems when a DBDMA wrote in a
middle of a cache line with
the MESH driver on a 8500 and possibly others. So if you are trying to
deal with such issues, you need
to flush/invalidate your data as well and make sure everything is cache
line aligned.
Ben.
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.