Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4565f017 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by Linus Torvalds
Browse files

dma-mapping: unify dma_get_cache_alignment implementations



dma_get_cache_alignment returns the minimum DMA alignment.  Architectures
defines it as ARCH_DMA_MINALIGN (formally ARCH_KMALLOC_MINALIGN).  So we
can unify dma_get_cache_alignment implementations.

Note that some architectures implement dma_get_cache_alignment wrongly.
dma_get_cache_alignment() should return the minimum DMA alignment.  So
fully-coherent architectures should return 1.  This patch also fixes this
issue.

Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a6eb9fe1
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -44,6 +44,5 @@ static inline int dma_set_mask(struct device *dev, u64 mask)
#define dma_is_consistent(d, h)			(1)

#define dma_cache_sync(dev, va, size, dir)		  ((void)0)
#define dma_get_cache_alignment()			  L1_CACHE_BYTES

#endif	/* _ALPHA_DMA_MAPPING_H */
+0 −5
Original line number Diff line number Diff line
@@ -144,11 +144,6 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
	return 0;
}

static inline int dma_get_cache_alignment(void)
{
	return 32;
}

static inline int dma_is_consistent(struct device *dev, dma_addr_t handle)
{
	return !!arch_is_coherent();
+0 −5
Original line number Diff line number Diff line
@@ -341,9 +341,4 @@ static inline int dma_is_consistent(struct device *dev, dma_addr_t dma_addr)
	return 1;
}

static inline int dma_get_cache_alignment(void)
{
	return boot_cpu_data.dcache.linesz;
}

#endif /* __ASM_AVR32_DMA_MAPPING_H */
+0 −1
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
#define dma_supported(d, m)         (1)
#define dma_get_cache_alignment()   (32)
#define dma_is_consistent(d, h)     (1)

static inline int
+0 −6
Original line number Diff line number Diff line
@@ -152,12 +152,6 @@ dma_set_mask(struct device *dev, u64 mask)
	return 0;
}

static inline int
dma_get_cache_alignment(void)
{
	return (1 << INTERNODE_CACHE_SHIFT);
}

#define dma_is_consistent(d, h)	(1)

static inline void
Loading