summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/ti-vpe/cal-video.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-12-07 00:53:43 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-01-04 11:44:41 +0100
commitcff615dba5c76d8c806d95e81ee6b8c66e3d7031 (patch)
tree16534588bf36f5e87ef71dda692f8dd8b228d9af /drivers/media/platform/ti-vpe/cal-video.c
parentcbb8cd7cc129f2920a3edf686bf2d7961cd1b00c (diff)
downloadlinux-cff615dba5c76d8c806d95e81ee6b8c66e3d7031.tar.bz2
media: ti-vpe: cal: Use spin_lock_irq() when starting or stopping stream
The cal_start_streaming() and cal_stop_streaming() functions are called with interrupts enabled. spin_lock_irq() can thus be used instead of spin_lock_irqsave(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/ti-vpe/cal-video.c')
-rw-r--r--drivers/media/platform/ti-vpe/cal-video.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/media/platform/ti-vpe/cal-video.c b/drivers/media/platform/ti-vpe/cal-video.c
index d3f805a512c0..de0ba6128715 100644
--- a/drivers/media/platform/ti-vpe/cal-video.c
+++ b/drivers/media/platform/ti-vpe/cal-video.c
@@ -492,12 +492,11 @@ static int cal_start_streaming(struct vb2_queue *vq, unsigned int count)
struct cal_dmaqueue *dma_q = &ctx->vidq;
struct cal_buffer *buf, *tmp;
unsigned long addr;
- unsigned long flags;
int ret;
- spin_lock_irqsave(&ctx->slock, flags);
+ spin_lock_irq(&ctx->slock);
if (list_empty(&dma_q->active)) {
- spin_unlock_irqrestore(&ctx->slock, flags);
+ spin_unlock_irq(&ctx->slock);
ctx_dbg(3, ctx, "buffer queue is empty\n");
return -EIO;
}
@@ -506,7 +505,7 @@ static int cal_start_streaming(struct vb2_queue *vq, unsigned int count)
ctx->cur_frm = buf;
ctx->next_frm = buf;
list_del(&buf->list);
- spin_unlock_irqrestore(&ctx->slock, flags);
+ spin_unlock_irq(&ctx->slock);
addr = vb2_dma_contig_plane_dma_addr(&ctx->cur_frm->vb.vb2_buf, 0);
ctx->sequence = 0;
@@ -534,7 +533,7 @@ err:
cal_ctx_disable_irqs(ctx);
ctx->dma_state = CAL_DMA_STOPPED;
- spin_lock_irqsave(&ctx->slock, flags);
+ spin_lock_irq(&ctx->slock);
vb2_buffer_done(&ctx->cur_frm->vb.vb2_buf, VB2_BUF_STATE_QUEUED);
ctx->cur_frm = NULL;
ctx->next_frm = NULL;
@@ -542,7 +541,7 @@ err:
list_del(&buf->list);
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_QUEUED);
}
- spin_unlock_irqrestore(&ctx->slock, flags);
+ spin_unlock_irq(&ctx->slock);
return ret;
}
@@ -551,7 +550,6 @@ static void cal_stop_streaming(struct vb2_queue *vq)
struct cal_ctx *ctx = vb2_get_drv_priv(vq);
struct cal_dmaqueue *dma_q = &ctx->vidq;
struct cal_buffer *buf, *tmp;
- unsigned long flags;
cal_ctx_wr_dma_stop(ctx);
cal_ctx_disable_irqs(ctx);
@@ -559,7 +557,7 @@ static void cal_stop_streaming(struct vb2_queue *vq)
v4l2_subdev_call(&ctx->phy->subdev, video, s_stream, 0);
/* Release all active buffers */
- spin_lock_irqsave(&ctx->slock, flags);
+ spin_lock_irq(&ctx->slock);
list_for_each_entry_safe(buf, tmp, &dma_q->active, list) {
list_del(&buf->list);
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
@@ -574,7 +572,7 @@ static void cal_stop_streaming(struct vb2_queue *vq)
}
ctx->cur_frm = NULL;
ctx->next_frm = NULL;
- spin_unlock_irqrestore(&ctx->slock, flags);
+ spin_unlock_irq(&ctx->slock);
pm_runtime_put_sync(ctx->cal->dev);
}