Re: consistent_sync_for_cpu() and friends on ppc32

From: David S. Miller
Date: Tue Mar 16 2004 - 13:48:59 EST


On Tue, 16 Mar 2004 12:36:07 +1100
Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> wrote:

> Hrm... I'm still not sure how I'm supposed to implement those
> for non-consistent PPCs (embedded). We don't carry state information
> around, so I suppose I'll have to rely on the direction beeing the
> same for the whole duration of the operation... In which case, it's
> just a matter of having for_cpu nop'ing when direction is TO_DEVICE
> and for_device nop'ing when direction is FROM_DEVICE ? Not clear
> imho...

See, the direction really doesn't matter for the sync ops.

If you flush the cpu caches at MAP time, and your PCI controller doesn't
have DMA caching or something like that, then sync for CPU can always be
a nop. You will have always previously flushed the cpu caches before
giving the buffer back to the device, either via MAP or sync for device
calls.

So basically, make MAP and sync for device writeback flush the cpu caches.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/