From patchwork Thu Jul 11 09:06:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826132 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 301F5C0AB2 for ; Thu, 11 Jul 2013 09:14:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 012E920107 for ; Thu, 11 Jul 2013 09:14:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B96EA200E0 for ; Thu, 11 Jul 2013 09:13:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932623Ab3GKJMt (ORCPT ); Thu, 11 Jul 2013 05:12:49 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:60075 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932599Ab3GKJMq (ORCPT ); Thu, 11 Jul 2013 05:12:46 -0400 Received: by mail-pd0-f175.google.com with SMTP id 4so7289136pdd.6 for ; Thu, 11 Jul 2013 02:12:45 -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=VhPA7qNFRIurNe2nlo6TCUw4+ef4+Chywy/5miBxGX8=; b=oyCU6Rm9u/nRJHyXdxG59AsdlzBqVSGTUxjWDOVh7qINd+dnmOeuE9fXYlxQzglpu1 yGyau41EiJ7qMNzzXu1Hzvnd0y71QXJmeTFy916uVCReNPT0cCEeJCmEk73NNIMSl0G4 w+EOh8D6TD99U6qwp5R9cMPWkradfeDMahRA7cEDP/Meuj4x151Zb1oPmos7SJLwB5dN iXQkLLafaUGrTcAiZ6wT+ohzOI3G2Gl12t1Qcl2bKzxs01VcmBGNAYCIB661S0pDO6Nz Tg40x+SpKbnIpGlLANQU0P4FmkPxLSs+J8d+rahRTKyGAASSbCi8ZU+hm2Z+m4KvB/2V Q7dA== X-Received: by 10.68.163.225 with SMTP id yl1mr14013776pbb.160.1373533965722; Thu, 11 Jul 2013 02:12:45 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id vu5sm41089144pab.10.2013.07.11.02.12.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:12:44 -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 , Clemens Ladisch , Jaroslav Kysela , Takashi Iwai Subject: [PATCH 46/50] Sound: usb: ua101: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:06:09 +0800 Message-Id: <1373533573-12272-47-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 disable local interrupt before holding a global lock which is held without irqsave. Cc: Clemens Ladisch Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Signed-off-by: Ming Lei --- sound/usb/misc/ua101.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c index 8b5d2c5..52a60c6 100644 --- a/sound/usb/misc/ua101.c +++ b/sound/usb/misc/ua101.c @@ -613,14 +613,24 @@ static int start_usb_playback(struct ua101 *ua) static void abort_alsa_capture(struct ua101 *ua) { - if (test_bit(ALSA_CAPTURE_RUNNING, &ua->states)) + if (test_bit(ALSA_CAPTURE_RUNNING, &ua->states)) { + unsigned long flags; + + local_irq_save(flags); snd_pcm_stop(ua->capture.substream, SNDRV_PCM_STATE_XRUN); + local_irq_restore(flags); + } } static void abort_alsa_playback(struct ua101 *ua) { - if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states)) + if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states)) { + unsigned long flags; + + local_irq_save(flags); snd_pcm_stop(ua->playback.substream, SNDRV_PCM_STATE_XRUN); + local_irq_restore(flags); + } } static int set_stream_hw(struct ua101 *ua, struct snd_pcm_substream *substream,