Re: [PATCH] ppc32 copy_to_user dcbt fixup

From: Bryan Rittmeyer
Date: Sun Mar 14 2004 - 17:35:01 EST


On Sat, Mar 13, 2004 at 03:39:57PM +0100, Danjel McGougan wrote:
> The obvious solution is to invalidate the dcache
> *after* DMA completion. It seems hard to guarantee that nobody will
> touch the memory area in question during the DMA.

You need to invalidate prior to submitting for DMA. Otherwise if the
region is dirty the CPU may write back after DMA has begun, causing a
data corrupting race.

Invalidating before _and_ after is expensive; better to fix the misreads.

-Bryan

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