From: Michal Simek Date: Mon, 26 Apr 2010 11:49:01 +0000 (+0200) Subject: microblaze: Fix kmalloc alignment on non-coherent DMA platforms X-Git-Tag: upstream/snapshot3+hdmi~14698^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de925d9d3b64390ef6363e16e9d6a84d7dd7cee1;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git microblaze: Fix kmalloc alignment on non-coherent DMA platforms Based on PowerPC patche 52142e756e9bf6485d3d53596e8aff2e816a7253 PowerPC description: 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: Michal Simek --- diff --git a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h index 9b12902..de493f8 100644 --- a/arch/microblaze/include/asm/page.h +++ b/arch/microblaze/include/asm/page.h @@ -31,6 +31,9 @@ #ifndef __ASSEMBLY__ +/* MS be sure that SLAB allocates aligned objects */ +#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES + #define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1))) #define PAGE_DOWN(addr) ((addr)&(~((PAGE_SIZE)-1)))