]> err.no Git - linux-2.6/commitdiff
[POWERPC] Fix kmalloc alignment on non-coherent DMA platforms
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 19 Nov 2007 08:25:06 +0000 (19:25 +1100)
committerPaul Mackerras <paulus@samba.org>
Tue, 20 Nov 2007 00:37:43 +0000 (11:37 +1100)
On platforms doing non-coherent DMA (4xx, 8xx, ...), it's important
that the kmalloc minimum alignment is set to the cache line size, to
avoid sharing cache lines between different objects, so that DMA to
one of the objects doesn't corrupt the other.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
include/asm-powerpc/page_32.h

index 374d0db37e1c1babf0ee08d935d5f3888e443f6c..17110aff26e708c242d9d2fd3855d5d48aea204f 100644 (file)
@@ -6,6 +6,10 @@
 
 #define PPC_MEMSTART   0
 
+#ifdef CONFIG_NOT_COHERENT_CACHE
+#define ARCH_KMALLOC_MINALIGN  L1_CACHE_BYTES
+#endif
+
 #ifndef __ASSEMBLY__
 /*
  * The basic type of a PTE - 64 bits for those CPUs with > 32 bit