[AVR32] Define ARCH_KMALLOC_MINALIGN to L1_CACHE_BYTES

This allows SLUB debugging to be used without fear of messing up DMA
transfers. SPI is one example that easily breaks without this patch.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>

+9
+9
include/asm-avr32/cache.h
··· 4 #define L1_CACHE_SHIFT 5 5 #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) 6 7 #ifndef __ASSEMBLER__ 8 struct cache_info { 9 unsigned int ways;
··· 4 #define L1_CACHE_SHIFT 5 5 #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) 6 7 + /* 8 + * Memory returned by kmalloc() may be used for DMA, so we must make 9 + * sure that all such allocations are cache aligned. Otherwise, 10 + * unrelated code may cause parts of the buffer to be read into the 11 + * cache before the transfer is done, causing old data to be seen by 12 + * the CPU. 13 + */ 14 + #define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES 15 + 16 #ifndef __ASSEMBLER__ 17 struct cache_info { 18 unsigned int ways;