Skip to content

Commit

Permalink
dmaengine: rcar-dmac: Allocate hardware descriptors with DMAC device
Browse files Browse the repository at this point in the history
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: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Laurent Pinchart authored and Vinod Koul committed Feb 16, 2015
1 parent f7638c9 commit 6a63480
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/dma/sh/rcar-dmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,17 +655,17 @@ static void rcar_dmac_realloc_hwdesc(struct rcar_dmac_chan *chan,
return;

if (desc->hwdescs.mem) {
dma_free_coherent(NULL, desc->hwdescs.size, desc->hwdescs.mem,
desc->hwdescs.dma);
dma_free_coherent(chan->chan.device->dev, desc->hwdescs.size,
desc->hwdescs.mem, desc->hwdescs.dma);
desc->hwdescs.mem = NULL;
desc->hwdescs.size = 0;
}

if (!size)
return;

desc->hwdescs.mem = dma_alloc_coherent(NULL, size, &desc->hwdescs.dma,
GFP_NOWAIT);
desc->hwdescs.mem = dma_alloc_coherent(chan->chan.device->dev, size,
&desc->hwdescs.dma, GFP_NOWAIT);
if (!desc->hwdescs.mem)
return;

Expand Down

0 comments on commit 6a63480

Please sign in to comment.