From patchwork Thu Jul 11 09:05:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826074 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 5A4139F7D6 for ; Thu, 11 Jul 2013 09:07:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A22392011B for ; Thu, 11 Jul 2013 09:07:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 716AC200B9 for ; Thu, 11 Jul 2013 09:07:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932084Ab3GKJH1 (ORCPT ); Thu, 11 Jul 2013 05:07:27 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:34777 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756038Ab3GKJHX (ORCPT ); Thu, 11 Jul 2013 05:07:23 -0400 Received: by mail-pa0-f54.google.com with SMTP id kx10so7668216pab.41 for ; Thu, 11 Jul 2013 02:07:22 -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=/OXR0BwXunrOtahAP3tUpDiJxga8xN/63ST5dIKVY4w=; b=SfXF3z0NNnLiLlDoTYvG2dPcVAxmtoGNGt6SSpQQYcnZMUcxzq+gbRzzDI1DnxyqOJ 1NMSLLwhhSGs0BakQsExBzmOnkC8aTGVm78cKod+RkLd7PwI5u4YUT2XKSaFLiwgMt3u 952D1vMb0g1OXy5eq/1kcgwOT6AANG9uOp4BRr9pdIkEFYzDsoyuqTz7A2NRE/726hLA rN2wzrQMTLuINyT42zYhq7iMLv9/yiZyhpyVl4WjjifQCrGf0haGTvt5j4gaD7KWPSGD nl5XSS7BFUW9qY2ToC2GyM/IZ9dl8pqDQEc22VCdmGg4mFu2fDnE9RjhOXASbmHqsPC2 rWsg== X-Received: by 10.68.139.40 with SMTP id qv8mr35735293pbb.107.1373533642659; Thu, 11 Jul 2013 02:07:22 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id tr10sm7396781pbc.22.2013.07.11.02.07.18 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:07:21 -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 Subject: [PATCH 06/50] USB: iowarrior: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:29 +0800 Message-Id: <1373533573-12272-7-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(). Signed-off-by: Ming Lei --- drivers/usb/misc/iowarrior.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index d36f34e..010ed6d 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -162,6 +162,7 @@ static void iowarrior_callback(struct urb *urb) int offset; int status = urb->status; int retval; + unsigned long flags; switch (status) { case 0: @@ -175,7 +176,7 @@ static void iowarrior_callback(struct urb *urb) goto exit; } - spin_lock(&dev->intr_idx_lock); + spin_lock_irqsave(&dev->intr_idx_lock, flags); intr_idx = atomic_read(&dev->intr_idx); /* aux_idx become previous intr_idx */ aux_idx = (intr_idx == 0) ? (MAX_INTERRUPT_BUFFER - 1) : (intr_idx - 1); @@ -211,7 +212,7 @@ static void iowarrior_callback(struct urb *urb) *(dev->read_queue + offset + (dev->report_size)) = dev->serial_number++; atomic_set(&dev->intr_idx, aux_idx); - spin_unlock(&dev->intr_idx_lock); + spin_unlock_irqrestore(&dev->intr_idx_lock, flags); /* tell the blocking read about the new data */ wake_up_interruptible(&dev->read_wait);