From patchwork Thu Jul 11 09:05:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826223 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 454BDC0AB2 for ; Thu, 11 Jul 2013 09:19:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0FC3C200F2 for ; Thu, 11 Jul 2013 09:19:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE527200D0 for ; Thu, 11 Jul 2013 09:19:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756021Ab3GKJHM (ORCPT ); Thu, 11 Jul 2013 05:07:12 -0400 Received: from mail-pb0-f49.google.com ([209.85.160.49]:46240 "EHLO mail-pb0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755838Ab3GKJHI (ORCPT ); Thu, 11 Jul 2013 05:07:08 -0400 Received: by mail-pb0-f49.google.com with SMTP id jt11so7604133pbb.8 for ; Thu, 11 Jul 2013 02:07:07 -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=g6Jd6W21Wz4tPF1AsOlpnGC+v1o3YNUU3Fi63MrwnAY=; b=WvkHoAHWhFOqefM/mH1P83SkfVkS+KPYeJBb6CtCnVDQAO0oemjhHpVu1ef+9/DILD YgI3xc5mNjop6PXw6CgzO5W5tXhYoTutqMjnuOqqQcI0HoGAoRHabBZWY0f6YjFaQJtC +vfIHKGMbZdeTUOfxpgKE2cho3eXsXbgIRLMTg68eRnS3aHswbH7qzVljiu+8qTjmsTD lW5mtS9tZwWRNTTYS7PZSGUBwUN82rFpF9OVl0POrTnm0AqS3Fi6T2xGgyMcwCc1Ec/6 CYDBDgdxP6aR8Um0i/FouCHWjXpJ7DTbAsQ78rCXvn1fnlIhSOTcgjDFwyP/ISKsdmWE 4FtQ== X-Received: by 10.66.118.163 with SMTP id kn3mr37640271pab.165.1373533627728; Thu, 11 Jul 2013 02:07:07 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id il4sm6418389pbb.36.2013.07.11.02.07.03 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:07:06 -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 , Lisa Nguyen Subject: [PATCH 04/50] USB: adutux: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:27 +0800 Message-Id: <1373533573-12272-5-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, T_FRT_ADULT2, 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: Lisa Nguyen Signed-off-by: Ming Lei --- drivers/usb/misc/adutux.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c index eb3c8c1..387c75e 100644 --- a/drivers/usb/misc/adutux.c +++ b/drivers/usb/misc/adutux.c @@ -195,12 +195,13 @@ static void adu_interrupt_in_callback(struct urb *urb) { struct adu_device *dev = urb->context; int status = urb->status; + unsigned long flags; dbg(4, " %s : enter, status %d", __func__, status); adu_debug_data(5, __func__, urb->actual_length, urb->transfer_buffer); - spin_lock(&dev->buflock); + spin_lock_irqsave(&dev->buflock, flags); if (status != 0) { if ((status != -ENOENT) && (status != -ECONNRESET) && @@ -229,7 +230,7 @@ static void adu_interrupt_in_callback(struct urb *urb) exit: dev->read_urb_finished = 1; - spin_unlock(&dev->buflock); + spin_unlock_irqrestore(&dev->buflock, flags); /* always wake up so we recover from errors */ wake_up_interruptible(&dev->read_wait); adu_debug_data(5, __func__, urb->actual_length, @@ -241,6 +242,7 @@ static void adu_interrupt_out_callback(struct urb *urb) { struct adu_device *dev = urb->context; int status = urb->status; + unsigned long flags; dbg(4, " %s : enter, status %d", __func__, status); adu_debug_data(5, __func__, urb->actual_length, urb->transfer_buffer); @@ -254,10 +256,10 @@ static void adu_interrupt_out_callback(struct urb *urb) goto exit; } - spin_lock(&dev->buflock); + spin_lock_irqsave(&dev->buflock, flags); dev->out_urb_finished = 1; wake_up(&dev->write_wait); - spin_unlock(&dev->buflock); + spin_unlock_irqrestore(&dev->buflock, flags); exit: adu_debug_data(5, __func__, urb->actual_length,