@@ -566,8 +566,8 @@ static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
desc = dmaengine_prep_slave_sg(fh->chan,
buf->sg, sg_elems, DMA_DEV_TO_MEM,
DMA_PREP_INTERRUPT);
+ spin_lock_irq(&fh->queue_lock);
if (!desc) {
- spin_lock_irq(&fh->queue_lock);
list_del_init(&vb->queue);
vb->state = VIDEOBUF_PREPARED;
return;
@@ -576,8 +576,8 @@ static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
desc->callback_param = buf;
desc->callback = timblogiw_dma_cb;
+ spin_unlock_irq(&fh->queue_lock);
buf->cookie = desc->tx_submit(desc);
-
spin_lock_irq(&fh->queue_lock);
}
As sparse complains: drivers/media/platform/timblogiw.c:562:22: warning: context imbalance in 'buffer_queue' - unexpected unlock there's something weird at the logic there. The semaphore seems to be protecting changes at the desc struct, however, the callback logic is not protected. Compile-tested only. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> --- drivers/media/platform/timblogiw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)