Re: consistent_sync_for_cpu() and friends on ppc32

From: Benjamin Herrenschmidt
Date: Tue Mar 16 2004 - 17:08:07 EST



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

Well, the direction makes the difference between a flush and an
invalidation ;)

> 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.

No, flush on TO_DEVICE and BIDIRECTIONAL, invalidate on FROM_DEVICE,
it's less expensive to invalidate than flush in that case, since we
don't care about writing to real memory whatever junk the cache
contained for this area.

Ben.



-
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/