Re: [PATCH v1 41/49] media: usb: tm6000: prepare for enabling irq in complete()

2013-08-22 Thread Hans Verkuil
On Sat 17 August 2013 18:25:06 Ming Lei wrote:
> Complete() will be run with interrupt enabled, so change to
> spin_lock_irqsave().
> 
> Cc: Mauro Carvalho Chehab 
> Cc: linux-media@vger.kernel.org
> Signed-off-by: Ming Lei 

Acked-by: Hans Verkuil 

Regards,

Hans

> ---
>  drivers/media/usb/tm6000/tm6000-video.c |5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/usb/tm6000/tm6000-video.c 
> b/drivers/media/usb/tm6000/tm6000-video.c
> index cc1aa14..8bb440f 100644
> --- a/drivers/media/usb/tm6000/tm6000-video.c
> +++ b/drivers/media/usb/tm6000/tm6000-video.c
> @@ -434,6 +434,7 @@ static void tm6000_irq_callback(struct urb *urb)
>   struct tm6000_dmaqueue  *dma_q = urb->context;
>   struct tm6000_core *dev = container_of(dma_q, struct tm6000_core, vidq);
>   int i;
> + unsigned long flags;
>  
>   switch (urb->status) {
>   case 0:
> @@ -450,9 +451,9 @@ static void tm6000_irq_callback(struct urb *urb)
>   break;
>   }
>  
> - spin_lock(&dev->slock);
> + spin_lock_irqsave(&dev->slock, flags);
>   tm6000_isoc_copy(urb);
> - spin_unlock(&dev->slock);
> + spin_unlock_irqrestore(&dev->slock, flags);
>  
>   /* Reset urb buffers */
>   for (i = 0; i < urb->number_of_packets; i++) {
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v1 41/49] media: usb: tm6000: prepare for enabling irq in complete()

2013-08-17 Thread Ming Lei
Complete() will be run with interrupt enabled, so change to
spin_lock_irqsave().

Cc: Mauro Carvalho Chehab 
Cc: linux-media@vger.kernel.org
Signed-off-by: Ming Lei 
---
 drivers/media/usb/tm6000/tm6000-video.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/tm6000/tm6000-video.c 
b/drivers/media/usb/tm6000/tm6000-video.c
index cc1aa14..8bb440f 100644
--- a/drivers/media/usb/tm6000/tm6000-video.c
+++ b/drivers/media/usb/tm6000/tm6000-video.c
@@ -434,6 +434,7 @@ static void tm6000_irq_callback(struct urb *urb)
struct tm6000_dmaqueue  *dma_q = urb->context;
struct tm6000_core *dev = container_of(dma_q, struct tm6000_core, vidq);
int i;
+   unsigned long flags;
 
switch (urb->status) {
case 0:
@@ -450,9 +451,9 @@ static void tm6000_irq_callback(struct urb *urb)
break;
}
 
-   spin_lock(&dev->slock);
+   spin_lock_irqsave(&dev->slock, flags);
tm6000_isoc_copy(urb);
-   spin_unlock(&dev->slock);
+   spin_unlock_irqrestore(&dev->slock, flags);
 
/* Reset urb buffers */
for (i = 0; i < urb->number_of_packets; i++) {
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html