Skip to contentSkip to conversation

Don't unmap the memory for dma_sync*.

PATCH In review David Daney 2 participants 2 messages Oct 18, 2008 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't unmap the memory for dma_sync*.

Don't unmap the memory for dma_sync*.

This must have been typo, it cannot have been correct.

---
arch/mips/mm/dma-default.c | 2 --

1 files changed, 0 insertions(+), 2 deletions(-)
arch/mips/mm/dma-default.c +0 -0
index 891312f..5b98d0e 100644
@@ -324,7 +324,6 @@ void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
		if (cpu_is_noncoherent_r10000(dev))
			__dma_sync((unsigned long)page_address(sg_page(sg)),
			           sg->length, direction);
-		plat_unmap_dma_mem(sg->dma_address);
	}
}

@@ -342,7 +341,6 @@ void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nele

		if (!plat_device_is_coherent(dev))
			__dma_sync((unsigned long)page_address(sg_page(sg)),
			           sg->length, direction);
-		plat_unmap_dma_mem(sg->dma_address);
	}
}
#1 lore raw
Quoted 3 lines · David Daney

Don't unmap the memory for dma_sync*.

This must have been typo, it cannot have been correct.

Interesting ...

We were getting away with this for so long only because the only platform (Jazz) with a non-empty plat_unmap_dma_mem() doesn't call dma_sync_sg_for_cpu() and dma_sync_sg_for_device() from its commonly used drivers.

Ralf