Skip to content

Commit 3f3ff6e

Browse files
Sebastian Andrzej Siewiorgregkh
authored andcommitted
media: tm6000: use irqsave() in USB's complete callback
The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 273925c commit 3f3ff6e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/media/usb/tm6000/tm6000-video.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ static void tm6000_irq_callback(struct urb *urb)
419419
{
420420
struct tm6000_dmaqueue *dma_q = urb->context;
421421
struct tm6000_core *dev = container_of(dma_q, struct tm6000_core, vidq);
422+
unsigned long flags;
422423
int i;
423424

424425
switch (urb->status) {
@@ -436,9 +437,9 @@ static void tm6000_irq_callback(struct urb *urb)
436437
break;
437438
}
438439

439-
spin_lock(&dev->slock);
440+
spin_lock_irqsave(&dev->slock, flags);
440441
tm6000_isoc_copy(urb);
441-
spin_unlock(&dev->slock);
442+
spin_unlock_irqrestore(&dev->slock, flags);
442443

443444
/* Reset urb buffers */
444445
for (i = 0; i < urb->number_of_packets; i++) {

0 commit comments

Comments
 (0)