diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2018-07-10 18:18:29 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-08-02 19:49:35 +0200 |
commit | aa53bf0b03ae5e276c2714dc68e375d032bc9110 (patch) | |
tree | 0a0a96c2ab3c7b2486ec62dd9c990274e16a21c6 /drivers/media/usb/cx231xx/cx231xx-vbi.c | |
parent | media: camss: csid: Add support for events triggered by user controls (diff) | |
download | linux-aa53bf0b03ae5e276c2714dc68e375d032bc9110.tar.xz linux-aa53bf0b03ae5e276c2714dc68e375d032bc9110.zip |
media: cx231xx: 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 <bigeasy@linutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/usb/cx231xx/cx231xx-vbi.c')
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-vbi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-vbi.c b/drivers/media/usb/cx231xx/cx231xx-vbi.c index b621cf1aa96b..920417baf893 100644 --- a/drivers/media/usb/cx231xx/cx231xx-vbi.c +++ b/drivers/media/usb/cx231xx/cx231xx-vbi.c @@ -305,6 +305,7 @@ static void cx231xx_irq_vbi_callback(struct urb *urb) struct cx231xx_video_mode *vmode = container_of(dma_q, struct cx231xx_video_mode, vidq); struct cx231xx *dev = container_of(vmode, struct cx231xx, vbi_mode); + unsigned long flags; switch (urb->status) { case 0: /* success */ @@ -321,9 +322,9 @@ static void cx231xx_irq_vbi_callback(struct urb *urb) } /* Copy data from URB */ - spin_lock(&dev->vbi_mode.slock); + spin_lock_irqsave(&dev->vbi_mode.slock, flags); dev->vbi_mode.bulk_ctl.bulk_copy(dev, urb); - spin_unlock(&dev->vbi_mode.slock); + spin_unlock_irqrestore(&dev->vbi_mode.slock, flags); /* Reset status */ urb->status = 0; |