summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorBhupesh Sharma <bhupesh.sharma@st.com>2012-03-23 22:23:13 +0530
committerFelipe Balbi <balbi@ti.com>2012-04-10 19:11:51 +0300
commit6190c79df861d2c78a7448fe6d4260e5fa53b9b9 (patch)
tree3a88a39558e08df3c668f2ef0c96a77f07cd2638 /drivers/usb
parentf135617224b4a1113b26b8ee5877e94f38e40d1e (diff)
downloadop-kernel-dev-6190c79df861d2c78a7448fe6d4260e5fa53b9b9.zip
op-kernel-dev-6190c79df861d2c78a7448fe6d4260e5fa53b9b9.tar.gz
usb: gadget: uvc: Remove non-required locking from 'uvc_queue_next_buffer' routine
This patch removes the non-required spinlock acquire/release calls on 'queue->irqlock' from 'uvc_queue_next_buffer' routine. This routine is called from 'video->encode' function (which translates to either 'uvc_video_encode_bulk' or 'uvc_video_encode_isoc') in 'uvc_video.c'. As, the 'video->encode' routines are called with 'queue->irqlock' already held, so acquiring a 'queue->irqlock' again in 'uvc_queue_next_buffer' routine causes a spin lock recursion. Signed-off-by: Bhupesh Sharma <bhupesh.sharma@st.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/uvc_queue.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/usb/gadget/uvc_queue.c b/drivers/usb/gadget/uvc_queue.c
index d776adb..0cdf89d 100644
--- a/drivers/usb/gadget/uvc_queue.c
+++ b/drivers/usb/gadget/uvc_queue.c
@@ -543,11 +543,11 @@ done:
return ret;
}
+/* called with queue->irqlock held.. */
static struct uvc_buffer *
uvc_queue_next_buffer(struct uvc_video_queue *queue, struct uvc_buffer *buf)
{
struct uvc_buffer *nextbuf;
- unsigned long flags;
if ((queue->flags & UVC_QUEUE_DROP_INCOMPLETE) &&
buf->buf.length != buf->buf.bytesused) {
@@ -556,14 +556,12 @@ uvc_queue_next_buffer(struct uvc_video_queue *queue, struct uvc_buffer *buf)
return buf;
}
- spin_lock_irqsave(&queue->irqlock, flags);
list_del(&buf->queue);
if (!list_empty(&queue->irqqueue))
nextbuf = list_first_entry(&queue->irqqueue, struct uvc_buffer,
queue);
else
nextbuf = NULL;
- spin_unlock_irqrestore(&queue->irqlock, flags);
buf->buf.sequence = queue->sequence++;
do_gettimeofday(&buf->buf.timestamp);
OpenPOWER on IntegriCloud