From patchwork Thu Jul 11 09:05:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826108 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E663DC0AB2 for ; Thu, 11 Jul 2013 09:11:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C1232200E0 for ; Thu, 11 Jul 2013 09:11:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8CC322010E for ; Thu, 11 Jul 2013 09:11:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932483Ab3GKJLa (ORCPT ); Thu, 11 Jul 2013 05:11:30 -0400 Received: from mail-pb0-f48.google.com ([209.85.160.48]:57518 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932451Ab3GKJL0 (ORCPT ); Thu, 11 Jul 2013 05:11:26 -0400 Received: by mail-pb0-f48.google.com with SMTP id ma3so7639531pbc.21 for ; Thu, 11 Jul 2013 02:11:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=99CAr8tJ1EqV9iQac+6OgpAw8w5NNo8ew1UgAtxJ36M=; b=Co6xhpRrN/tSbylbjU+2G4dwMzRanVksHR7s9jlTmAL4ColhPfFjUm8IUmEI7S61uG zcwlTdZFGagy0mV08HI5A1RusnEsg+ecRNUNTP7xl0h6Nylkdm/1v/Y6rRRPe7CrFetV uTWqp0s9f4ZcfjaFRltKQND1saPqMGbCkDzf0xHQDKlI5SzvPPVh/pojCslplGmOSIsw JdlEmZ83qBDqJLn7oIlTw+Vx8iU7y+NSX89+9ortrW21r/yYDtbzKoAu5dpdJ8/oBpnx RlLECFHfC4P3xDXRwTshJDUVxVDR/tkRvh0ghfQRqfl5cskRJ24/VFREMV26nOGfbg/1 30qg== X-Received: by 10.68.95.66 with SMTP id di2mr34979483pbb.180.1373533885916; Thu, 11 Jul 2013 02:11:25 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id vb8sm38668900pbc.11.2013.07.11.02.11.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:11:25 -0700 (PDT) From: Ming Lei To: Greg Kroah-Hartman Cc: 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, Ming Lei , Mauro Carvalho Chehab Subject: [PATCH 36/50] media: usb: em28xx: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:59 +0800 Message-Id: <1373533573-12272-37-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1373533573-12272-1-git-send-email-ming.lei@canonical.com> References: <1373533573-12272-1-git-send-email-ming.lei@canonical.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Devin Heitmueller Tested-by: Devin Heitmueller --- 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++) {