mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
dmaengine: rcar-dmac: unmap slave resource when channel is freed
commit3139dc8dedupstream. The slave mapping should be removed together with other channel resources when the channel is freed. If it's not unmapped it will hang around forever after the channel is freed. Fixes:9f878603db("dmaengine: rcar-dmac: add iommu support for slave transfers") Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3bef7578e0
commit
172270c743
@@ -986,6 +986,7 @@ static void rcar_dmac_free_chan_resources(struct dma_chan *chan)
|
||||
{
|
||||
struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan);
|
||||
struct rcar_dmac *dmac = to_rcar_dmac(chan->device);
|
||||
struct rcar_dmac_chan_map *map = &rchan->map;
|
||||
struct rcar_dmac_desc_page *page, *_page;
|
||||
struct rcar_dmac_desc *desc;
|
||||
LIST_HEAD(list);
|
||||
@@ -1019,6 +1020,13 @@ static void rcar_dmac_free_chan_resources(struct dma_chan *chan)
|
||||
free_page((unsigned long)page);
|
||||
}
|
||||
|
||||
/* Remove slave mapping if present. */
|
||||
if (map->slave.xfer_size) {
|
||||
dma_unmap_resource(chan->device->dev, map->addr,
|
||||
map->slave.xfer_size, map->dir, 0);
|
||||
map->slave.xfer_size = 0;
|
||||
}
|
||||
|
||||
pm_runtime_put(chan->device->dev);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user