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

Commit ea7a8a53 authored by Vinayak Menon's avatar Vinayak Menon
Browse files

drivers: dma-removed: use relaxed memory attributes



For mapping, dma-removed uses ioremap which on ARM translates
to Device nGnRE. But since the users of dma-removed maps RAM
and does not have restrictions on gathering, reordering, and
speculation while mapped, use ioremap_wc instead. This is
observed to perform better. This patch fixes the variable
address space markings too.

Change-Id: Ic73f38ceb446f19a86cb3f64cbf029a61de6d350
Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
parent 67c0cad6
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -223,7 +223,7 @@ void *removed_alloc(struct device *dev, size_t size, dma_addr_t *handle,
	bool skip_zeroing = attrs & DMA_ATTR_SKIP_ZEROING;
	int pageno;
	unsigned long order;
	void *addr = NULL;
	void __iomem *addr = NULL;
	struct removed_region *dma_mem = dev->removed_mem;
	int nbits;
	unsigned int align;
@@ -261,7 +261,7 @@ void *removed_alloc(struct device *dev, size_t size, dma_addr_t *handle,
			goto out;
		}

		addr = ioremap(base, size);
		addr = ioremap_wc(base, size);
		if (WARN_ON(!addr)) {
			bitmap_clear(dma_mem->bitmap, pageno, nbits);
		} else {
@@ -355,10 +355,10 @@ void removed_sync_sg_for_device(struct device *dev,
{
}

void *removed_remap(struct device *dev, void *cpu_addr, dma_addr_t handle,
			size_t size, unsigned long attrs)
static void __iomem *removed_remap(struct device *dev, void *cpu_addr,
			dma_addr_t handle, size_t size, unsigned long attrs)
{
	return ioremap(handle, size);
	return ioremap_wc(handle, size);
}

void removed_unremap(struct device *dev, void *remapped_address, size_t size)