dma-mapping: always use VM_DMA_COHERENT for generic DMA remap
Currently the generic dma remap allocator gets a vm_flags passed by the caller that is a little confusing. We just introduced a generic vmalloc-level flag to identify the dma coherent allocations, so use that everywhere and remove the now pointless argument. Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
@@ -617,7 +617,7 @@ static void *iommu_dma_alloc_remap(struct device *dev, size_t size,
|
||||
< size)
|
||||
goto out_free_sg;
|
||||
|
||||
vaddr = dma_common_pages_remap(pages, size, VM_USERMAP, prot,
|
||||
vaddr = dma_common_pages_remap(pages, size, prot,
|
||||
__builtin_return_address(0));
|
||||
if (!vaddr)
|
||||
goto out_unmap;
|
||||
@@ -941,7 +941,7 @@ static void __iommu_dma_free(struct device *dev, size_t size, void *cpu_addr)
|
||||
pages = __iommu_dma_get_pages(cpu_addr);
|
||||
if (!pages)
|
||||
page = vmalloc_to_page(cpu_addr);
|
||||
dma_common_free_remap(cpu_addr, alloc_size, VM_USERMAP);
|
||||
dma_common_free_remap(cpu_addr, alloc_size);
|
||||
} else {
|
||||
/* Lowmem means a coherent atomic or CMA allocation */
|
||||
page = virt_to_page(cpu_addr);
|
||||
@@ -979,7 +979,7 @@ static void *iommu_dma_alloc_pages(struct device *dev, size_t size,
|
||||
pgprot_t prot = dma_pgprot(dev, PAGE_KERNEL, attrs);
|
||||
|
||||
cpu_addr = dma_common_contiguous_remap(page, alloc_size,
|
||||
VM_USERMAP, prot, __builtin_return_address(0));
|
||||
prot, __builtin_return_address(0));
|
||||
if (!cpu_addr)
|
||||
goto out_free_pages;
|
||||
|
||||
|
مرجع در شماره جدید
Block a user