From patchwork Thu Jul 11 09:06:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826117 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 290409F756 for ; Thu, 11 Jul 2013 09:12:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 71C20200E0 for ; Thu, 11 Jul 2013 09:12:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C5B362010E for ; Thu, 11 Jul 2013 09:12:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932571Ab3GKJMZ (ORCPT ); Thu, 11 Jul 2013 05:12:25 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:42314 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932451Ab3GKJMV (ORCPT ); Thu, 11 Jul 2013 05:12:21 -0400 Received: by mail-pa0-f54.google.com with SMTP id kx10so7648795pab.13 for ; Thu, 11 Jul 2013 02:12:21 -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=nNNR5exQ/6gSH60kLsevOQVtmPGmePs8ST9xNwJnsl0=; b=etrMbmwuQtDOH+NBv00G9l+kzisj5HG0SVxc24ZvvytLRQQ+0wGbUO781rzUyBKwFl Llw6DEhY97RJzwBAHbFiBzhjWvwnf0yxb10A3DQErL/5z89jPLfbXBwuEviLbNbJmY3N 3Kg/wXO6H6t/mOj/+dF74v0Nh47MeTefJVR9+WdFqyWl78tZt/G5MP1MdTrz9ty2GxaE 2kr/PCct+Za9viICJhVXC9yF9O4NmEKCHOEghfn082bF4Qfcx/wih3A0xZQ3OTUHHzK+ 5vqvwjaAg6yHMZMWh83/93ZTqfZZPbqGPkEQcpIjfv9YhejzX5v6FnlyRCZAgdD/jitl 3SFQ== X-Received: by 10.66.131.46 with SMTP id oj14mr36732889pab.111.1373533940956; Thu, 11 Jul 2013 02:12:20 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id vu5sm41087263pab.10.2013.07.11.02.12.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:12:20 -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 , Jaroslav Kysela , Takashi Iwai , Clemens Ladisch Subject: [PATCH 43/50] sound: usb: midi: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:06:06 +0800 Message-Id: <1373533573-12272-44-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: Jaroslav Kysela Cc: Takashi Iwai Cc: Clemens Ladisch Cc: alsa-devel@alsa-project.org Signed-off-by: Ming Lei --- sound/usb/midi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/usb/midi.c b/sound/usb/midi.c index b901f46..86af276 100644 --- a/sound/usb/midi.c +++ b/sound/usb/midi.c @@ -279,15 +279,16 @@ static void snd_usbmidi_out_urb_complete(struct urb* urb) struct out_urb_context *context = urb->context; struct snd_usb_midi_out_endpoint* ep = context->ep; unsigned int urb_index; + unsigned long flags; - spin_lock(&ep->buffer_lock); + spin_lock_irqsave(&ep->buffer_lock, flags); urb_index = context - ep->urbs; ep->active_urbs &= ~(1 << urb_index); if (unlikely(ep->drain_urbs)) { ep->drain_urbs &= ~(1 << urb_index); wake_up(&ep->drain_wait); } - spin_unlock(&ep->buffer_lock); + spin_unlock_irqrestore(&ep->buffer_lock, flags); if (urb->status < 0) { int err = snd_usbmidi_urb_error(urb->status); if (err < 0) {