From: Benjamin Herrenschmidt Date: Mon, 19 Nov 2007 08:25:06 +0000 (+1100) Subject: [POWERPC] Fix kmalloc alignment on non-coherent DMA platforms X-Git-Tag: v2.6.24-rc4~109^2~12 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52142e756e9bf6485d3d53596e8aff2e816a7253;p=linux-2.6 [POWERPC] Fix kmalloc alignment on non-coherent DMA platforms 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 Signed-off-by: Paul Mackerras --- diff --git a/include/asm-powerpc/page_32.h b/include/asm-powerpc/page_32.h index 374d0db37e..17110aff26 100644 --- a/include/asm-powerpc/page_32.h +++ b/include/asm-powerpc/page_32.h @@ -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