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: Ryan Rempel <email@hidden>
- Date: Fri, 12 Sep 2003 17:29:17 -0500
On Friday, September 12, 2003, at 10:12 AM, Benjamin Herrenschmidt
wrote:
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.
I don't know if I actually need to do this. The drivers are the
AppleCurio and AppleMaceEthernet drivers (i.e. the external SCSI and
built-in ethernet on the older machines). The calls are in the original
drivers from Darwin 0.9 (that is, I didn't put them there), so I'm not
sure if they're absolutely required. I haven't tried removing them to
see what happens yet.
_______________________________________________
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.