提交 6a634808 编写于 作者: L Laurent Pinchart 提交者: Vinod Koul

dmaengine: rcar-dmac: Allocate hardware descriptors with DMAC device

When wired to an IOMMU to access data, the DMAC accesses the hardware
descriptors through the IOMMU as well. We're using the DMA mapping API
to allocate the descriptors, but with a NULL device at the moment, which
prevents IOMMU mappings from being created. Fix this by passing the DMAC
device instead.
Signed-off-by: NLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: NGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 f7638c90
...@@ -655,8 +655,8 @@ static void rcar_dmac_realloc_hwdesc(struct rcar_dmac_chan *chan, ...@@ -655,8 +655,8 @@ static void rcar_dmac_realloc_hwdesc(struct rcar_dmac_chan *chan,
return; return;
if (desc->hwdescs.mem) { if (desc->hwdescs.mem) {
dma_free_coherent(NULL, desc->hwdescs.size, desc->hwdescs.mem, dma_free_coherent(chan->chan.device->dev, desc->hwdescs.size,
desc->hwdescs.dma); desc->hwdescs.mem, desc->hwdescs.dma);
desc->hwdescs.mem = NULL; desc->hwdescs.mem = NULL;
desc->hwdescs.size = 0; desc->hwdescs.size = 0;
} }
...@@ -664,8 +664,8 @@ static void rcar_dmac_realloc_hwdesc(struct rcar_dmac_chan *chan, ...@@ -664,8 +664,8 @@ static void rcar_dmac_realloc_hwdesc(struct rcar_dmac_chan *chan,
if (!size) if (!size)
return; return;
desc->hwdescs.mem = dma_alloc_coherent(NULL, size, &desc->hwdescs.dma, desc->hwdescs.mem = dma_alloc_coherent(chan->chan.device->dev, size,
GFP_NOWAIT); &desc->hwdescs.dma, GFP_NOWAIT);
if (!desc->hwdescs.mem) if (!desc->hwdescs.mem)
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册