From patchwork Thu Jul 11 09:05:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826215 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B2CC69F756 for ; Thu, 11 Jul 2013 09:18:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9211A200D0 for ; Thu, 11 Jul 2013 09:18:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4FDD220107 for ; Thu, 11 Jul 2013 09:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932105Ab3GKJHr (ORCPT ); Thu, 11 Jul 2013 05:07:47 -0400 Received: from mail-pb0-f51.google.com ([209.85.160.51]:50418 "EHLO mail-pb0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932090Ab3GKJHn (ORCPT ); Thu, 11 Jul 2013 05:07:43 -0400 Received: by mail-pb0-f51.google.com with SMTP id um15so7615767pbc.38 for ; Thu, 11 Jul 2013 02:07:42 -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=c06PzPL/2g4EIMFSNVfFOpZZ8bllZVPW+E8NLY3ZqZw=; b=W+6NaijqtQ0DXx3AhWjil4l8vQTZZLC1Pwg+fQubr4uacd0hRwDLGZ/FWYszT4mU9Q iDYx38SUjFlpTpAJ92udC2+AarJPdb/eCEwFyk57RGRUmpTeEd5I0kD5UmULhq95ZUgd jYQzWn7vwYTSxUk1A7GZvpjiNR32S8jnHYm6gfAuGVjzGPmjuPTST41GL/U8zKLsuD0G 6XgILe1omMnlGDGrLj21xKxmh8/5flTnCFgokF7Vtpb8Jc3e15tbpeU9tMbT1zSn/2vr T0hsoXGt4Dw5mxoh7sxX1gtEtqAKfkUrFRstzCPzaVVmHJuFsZDS3LnL0yK50bfDCn6j FVEw== X-Received: by 10.67.3.99 with SMTP id bv3mr37191209pad.140.1373533662818; Thu, 11 Jul 2013 02:07:42 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id fl2sm41024638pab.23.2013.07.11.02.07.33 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:07:41 -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 , Juergen Stuber Subject: [PATCH 08/50] USB: legousbtower: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:31 +0800 Message-Id: <1373533573-12272-9-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=unavailable 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: Juergen Stuber Signed-off-by: Ming Lei --- drivers/usb/misc/legousbtower.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index 8089479..4044989 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c @@ -771,6 +771,7 @@ static void tower_interrupt_in_callback (struct urb *urb) struct lego_usb_tower *dev = urb->context; int status = urb->status; int retval; + unsigned long flags; dbg(4, "%s: enter, status %d", __func__, status); @@ -788,7 +789,7 @@ static void tower_interrupt_in_callback (struct urb *urb) } if (urb->actual_length > 0) { - spin_lock (&dev->read_buffer_lock); + spin_lock_irqsave (&dev->read_buffer_lock, flags); if (dev->read_buffer_length + urb->actual_length < read_buffer_size) { memcpy (dev->read_buffer + dev->read_buffer_length, dev->interrupt_in_buffer, @@ -799,7 +800,7 @@ static void tower_interrupt_in_callback (struct urb *urb) } else { printk(KERN_WARNING "%s: read_buffer overflow, %d bytes dropped", __func__, urb->actual_length); } - spin_unlock (&dev->read_buffer_lock); + spin_unlock_irqrestore (&dev->read_buffer_lock, flags); } resubmit: