Skip to content

Commit

Permalink
[AVR32] Define ARCH_KMALLOC_MINALIGN to L1_CACHE_BYTES
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Haavard Skinnemoen committed Jun 14, 2007
1 parent 2fdfe8d commit 093d0fa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/asm-avr32/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
#define L1_CACHE_SHIFT 5
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)

/*
* Memory returned by kmalloc() may be used for DMA, so we must make
* sure that all such allocations are cache aligned. Otherwise,
* unrelated code may cause parts of the buffer to be read into the
* cache before the transfer is done, causing old data to be seen by
* the CPU.
*/
#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES

#ifndef __ASSEMBLER__
struct cache_info {
unsigned int ways;
Expand Down

0 comments on commit 093d0fa

Please sign in to comment.