media: omap3isp: use sgtable-based scatterlist wrappers
commit 3de572fe2189a4a0bd80295e1f478401e739498e upstream. Use common wrappers operating directly on the struct sg_table objects to fix incorrect use of scatterlists sync calls. dma_sync_sg_for_*() functions have to be called with the number of elements originally passed to dma_map_sg_*() function, not the one returned in sgtable's nents. Fixes:d33186d0be
("[media] omap3isp: ccdc: Use the DMA API for LSC") Fixes:0e24e90f2c
("[media] omap3isp: stat: Use the DMA API") CC: stable@vger.kernel.org Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ac3a8e37cb
commit
dfb2add0ba
@@ -446,8 +446,8 @@ static int ccdc_lsc_config(struct isp_ccdc_device *ccdc,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
dma_sync_sg_for_cpu(isp->dev, req->table.sgt.sgl,
|
dma_sync_sgtable_for_cpu(isp->dev, &req->table.sgt,
|
||||||
req->table.sgt.nents, DMA_TO_DEVICE);
|
DMA_TO_DEVICE);
|
||||||
|
|
||||||
if (copy_from_user(req->table.addr, config->lsc,
|
if (copy_from_user(req->table.addr, config->lsc,
|
||||||
req->config.size)) {
|
req->config.size)) {
|
||||||
@@ -455,8 +455,8 @@ static int ccdc_lsc_config(struct isp_ccdc_device *ccdc,
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
dma_sync_sg_for_device(isp->dev, req->table.sgt.sgl,
|
dma_sync_sgtable_for_device(isp->dev, &req->table.sgt,
|
||||||
req->table.sgt.nents, DMA_TO_DEVICE);
|
DMA_TO_DEVICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_lock_irqsave(&ccdc->lsc.req_lock, flags);
|
spin_lock_irqsave(&ccdc->lsc.req_lock, flags);
|
||||||
|
@@ -161,8 +161,7 @@ static void isp_stat_buf_sync_for_device(struct ispstat *stat,
|
|||||||
if (ISP_STAT_USES_DMAENGINE(stat))
|
if (ISP_STAT_USES_DMAENGINE(stat))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dma_sync_sg_for_device(stat->isp->dev, buf->sgt.sgl,
|
dma_sync_sgtable_for_device(stat->isp->dev, &buf->sgt, DMA_FROM_DEVICE);
|
||||||
buf->sgt.nents, DMA_FROM_DEVICE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void isp_stat_buf_sync_for_cpu(struct ispstat *stat,
|
static void isp_stat_buf_sync_for_cpu(struct ispstat *stat,
|
||||||
@@ -171,8 +170,7 @@ static void isp_stat_buf_sync_for_cpu(struct ispstat *stat,
|
|||||||
if (ISP_STAT_USES_DMAENGINE(stat))
|
if (ISP_STAT_USES_DMAENGINE(stat))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dma_sync_sg_for_cpu(stat->isp->dev, buf->sgt.sgl,
|
dma_sync_sgtable_for_cpu(stat->isp->dev, &buf->sgt, DMA_FROM_DEVICE);
|
||||||
buf->sgt.nents, DMA_FROM_DEVICE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void isp_stat_buf_clear(struct ispstat *stat)
|
static void isp_stat_buf_clear(struct ispstat *stat)
|
||||||
|
Reference in New Issue
Block a user