Skip to content

Commit

Permalink
microblaze: Fix kmalloc alignment on non-coherent DMA platforms
Browse files Browse the repository at this point in the history
Based on PowerPC patche 52142e7

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 <monstr@monstr.eu>
  • Loading branch information
Michal Simek committed May 6, 2010
1 parent c17e1a1 commit de925d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/microblaze/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

Expand Down

0 comments on commit de925d9

Please sign in to comment.