Skip to content

Commit

Permalink
[POWERPC] Fix kmalloc alignment on non-coherent DMA platforms
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Nov 20, 2007
1 parent f9b6c1d commit 52142e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/asm-powerpc/page_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 52142e7

Please sign in to comment.