Skip to content

Commit c6673cb

Browse files
fujitacmetcalf-tilera
authored andcommitted
tile: set ARCH_KMALLOC_MINALIGN
Architectures that handle DMA-non-coherent memory need to set ARCH_KMALLOC_MINALIGN to make sure that kmalloc'ed buffer is DMA-safe: the buffer doesn't share a cache with the others. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Chris Metcalf <cmetcalf@tilera.com>
1 parent 4b2bf4b commit c6673cb

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎arch/tile/include/asm/cache.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@
3131
#define L2_CACHE_BYTES (1 << L2_CACHE_SHIFT)
3232
#define L2_CACHE_ALIGN(x) (((x)+(L2_CACHE_BYTES-1)) & -L2_CACHE_BYTES)
3333

34+
/*
35+
* TILE-Gx is fully coherents so we don't need to define
36+
* ARCH_KMALLOC_MINALIGN.
37+
*/
38+
#ifndef __tilegx__
39+
#define ARCH_KMALLOC_MINALIGN L2_CACHE_BYTES
40+
#endif
41+
3442
/* use the cache line size for the L2, which is where it counts */
3543
#define SMP_CACHE_BYTES_SHIFT L2_CACHE_SHIFT
3644
#define SMP_CACHE_BYTES L2_CACHE_BYTES

0 commit comments

Comments
 (0)