Subject: Re: question on howto use invalidate_dcache_range

From: Roland Dreier <[email-masked]>
Date: 13 Mar 2003 10:19:07 -0800

Joakim> Yes, but you still need to invalidate the buffer before
    Joakim> also or invalidate it when the buffer is freed which may
    Joakim> be possible if you are using your own buffer mgmt.

    Dan> Why?

Is the following not possible:

  CPU has a dirty cache line inside the buffer
  Driver tells device to start DMA
  Device finishes DMA
  CPU writes back dirty cache line
  Driver gets notification that DMA completed
  Driver invalidates cache for buffer

The invalidate above is too late: the data is already corrupted by the
write back of the dirty cache.

 - Roland

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/