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

Commit 002e6745 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

dma-direct: rename dma_noop to dma_direct



The trivial direct mapping implementation already does a virtual to
physical translation which isn't strictly a noop, and will soon learn
to do non-direct but linear physical to dma translations through the
device offset and a few small tricks.  Rename it to a better fitting
name.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarVladimir Murzin <vladimir.murzin@arm.com>
parent c5cd037d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4334,7 +4334,7 @@ T: git git://git.infradead.org/users/hch/dma-mapping.git
W:	http://git.infradead.org/users/hch/dma-mapping.git
S:	Supported
F:	lib/dma-debug.c
F:	lib/dma-noop.c
F:	lib/dma-direct.c
F:	lib/dma-virt.c
F:	drivers/base/dma-mapping.c
F:	drivers/base/dma-coherent.c
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ config ARM
	select CLONE_BACKWARDS
	select CPU_PM if (SUSPEND || CPU_IDLE)
	select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS
	select DMA_NOOP_OPS if !MMU
	select DMA_DIRECT_OPS if !MMU
	select EDAC_SUPPORT
	select EDAC_ATOMIC_SCRUB
	select GENERIC_ALLOCATOR
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ extern const struct dma_map_ops arm_coherent_dma_ops;

static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
{
	return IS_ENABLED(CONFIG_MMU) ? &arm_dma_ops : &dma_noop_ops;
	return IS_ENABLED(CONFIG_MMU) ? &arm_dma_ops : &dma_direct_ops;
}

#ifdef __arch_page_to_dma
+4 −4
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
#include "dma.h"

/*
 *  dma_noop_ops is used if
 *  dma_direct_ops is used if
 *   - MMU/MPU is off
 *   - cpu is v7m w/o cache support
 *   - device is coherent
@@ -39,7 +39,7 @@ static void *arm_nommu_dma_alloc(struct device *dev, size_t size,
				 unsigned long attrs)

{
	const struct dma_map_ops *ops = &dma_noop_ops;
	const struct dma_map_ops *ops = &dma_direct_ops;
	void *ret;

	/*
@@ -70,7 +70,7 @@ static void arm_nommu_dma_free(struct device *dev, size_t size,
			       void *cpu_addr, dma_addr_t dma_addr,
			       unsigned long attrs)
{
	const struct dma_map_ops *ops = &dma_noop_ops;
	const struct dma_map_ops *ops = &dma_direct_ops;

	if (attrs & DMA_ATTR_NON_CONSISTENT) {
		ops->free(dev, size, cpu_addr, dma_addr, attrs);
@@ -213,7 +213,7 @@ EXPORT_SYMBOL(arm_nommu_dma_ops);

static const struct dma_map_ops *arm_nommu_get_dma_map_ops(bool coherent)
{
	return coherent ? &dma_noop_ops : &arm_nommu_dma_ops;
	return coherent ? &dma_direct_ops : &arm_nommu_dma_ops;
}

void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ config M32R
	select MODULES_USE_ELF_RELA
	select HAVE_DEBUG_STACKOVERFLOW
	select CPU_NO_EFFICIENT_FFS
	select DMA_NOOP_OPS
	select DMA_DIRECT_OPS
	select ARCH_NO_COHERENT_DMA_MMAP if !MMU

config SBUS
Loading