Return-path: Received: from mail-wg0-f42.google.com ([74.125.82.42]:35939 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932260Ab3GKMmu (ORCPT ); Thu, 11 Jul 2013 08:42:50 -0400 Received: by mail-wg0-f42.google.com with SMTP id z11so11935694wgg.3 for ; Thu, 11 Jul 2013 05:42:49 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1373533573-12272-37-git-send-email-ming.lei@canonical.com> References: <1373533573-12272-1-git-send-email-ming.lei@canonical.com> <1373533573-12272-37-git-send-email-ming.lei@canonical.com> Date: Thu, 11 Jul 2013 08:42:49 -0400 Message-ID: (sfid-20130711_144300_140277_F502B7AC) Subject: Re: [PATCH 36/50] media: usb: em28xx: spin_lock in complete() cleanup From: Devin Heitmueller To: Ming Lei Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, Oliver Neukum , Alan Stern , linux-input@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-media@vger.kernel.org, alsa-devel@alsa-project.org, Mauro Carvalho Chehab Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Thu, Jul 11, 2013 at 5:05 AM, 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 > --- > drivers/media/usb/em28xx/em28xx-core.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c > index fc157af..0d698f9 100644 > --- a/drivers/media/usb/em28xx/em28xx-core.c > +++ b/drivers/media/usb/em28xx/em28xx-core.c > @@ -941,6 +941,7 @@ static void em28xx_irq_callback(struct urb *urb) > { > struct em28xx *dev = urb->context; > int i; > + unsigned long flags; > > switch (urb->status) { > case 0: /* success */ > @@ -956,9 +957,9 @@ static void em28xx_irq_callback(struct urb *urb) > } > > /* Copy data from URB */ > - spin_lock(&dev->slock); > + spin_lock_irqsave(&dev->slock, flags); > dev->usb_ctl.urb_data_copy(dev, 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 majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html I actually stumbled across this a couple of weeks ago, and have had an identical patch running in a local dev tree. Reviewed-by: Devin Heitmueller Tested-by: Devin Heitmueller -- Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com