Commit 20c29a97 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'dma-mapping-4.14-2' of git://git.infradead.org/users/hch/dma-mapping

Pull dma mapping fix from Christoph Hellwig:
 "A fix for a fix that went in this merge window from Arnd"

* tag 'dma-mapping-4.14-2' of git://git.infradead.org/users/hch/dma-mapping:
  dma-coherent: fix rmem_dma_device_init regression
parents c52f56a6 6d573398
...@@ -348,17 +348,16 @@ static int rmem_dma_device_init(struct reserved_mem *rmem, struct device *dev) ...@@ -348,17 +348,16 @@ static int rmem_dma_device_init(struct reserved_mem *rmem, struct device *dev)
struct dma_coherent_mem *mem = rmem->priv; struct dma_coherent_mem *mem = rmem->priv;
int ret; int ret;
if (!mem) if (!mem) {
return -ENODEV; ret = dma_init_coherent_memory(rmem->base, rmem->base,
rmem->size,
ret = dma_init_coherent_memory(rmem->base, rmem->base, rmem->size,
DMA_MEMORY_EXCLUSIVE, &mem); DMA_MEMORY_EXCLUSIVE, &mem);
if (ret) { if (ret) {
pr_err("Reserved memory: failed to init DMA memory pool at %pa, size %ld MiB\n", pr_err("Reserved memory: failed to init DMA memory pool at %pa, size %ld MiB\n",
&rmem->base, (unsigned long)rmem->size / SZ_1M); &rmem->base, (unsigned long)rmem->size / SZ_1M);
return ret; return ret;
} }
}
mem->use_dev_dma_pfn_offset = true; mem->use_dev_dma_pfn_offset = true;
rmem->priv = mem; rmem->priv = mem;
dma_assign_coherent_memory(dev, mem); dma_assign_coherent_memory(dev, mem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment