From patchwork Thu Jul 11 09:06:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826137 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 43AEF9F756 for ; Thu, 11 Jul 2013 09:14:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC15A20107 for ; Thu, 11 Jul 2013 09:14:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 05FCE20121 for ; Thu, 11 Jul 2013 09:14:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932582Ab3GKJMe (ORCPT ); Thu, 11 Jul 2013 05:12:34 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:42452 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932535Ab3GKJMa (ORCPT ); Thu, 11 Jul 2013 05:12:30 -0400 Received: by mail-pd0-f174.google.com with SMTP id 10so7271991pdc.5 for ; Thu, 11 Jul 2013 02:12:29 -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=xty3uPbFrbPM4uhJrTHWADWUuY4pCdvQ+MZB2hVi/nM=; b=RaJlDUQ1omSdyVqF7QRkDfv2Yh8ghk7Tp+jHfHdWgFGLJvzd19GAWSfRYvTXHnuVsX OlL3kE95iuX9NI7+OSv2pYsjFK9CxlNnTokLBGjgVNfzRf64DY+KMfqQ76+DopW2CVGe x0VoNkjozclvQQt5HORZkXmVddAuVzeQCL3lxa6eePnggygQkSS8+Gbgst/0eKcT+x4i UOOoWQvZTIQlmSNh32gNeGyjXUR3fgorlbbaLU6L6h0IrLj6sXdO8PhF1dn9zNTumdUp WpRFurrqGa1+qLmRKCU+rhtxKsqHgE0mfnCIwfoqCG+0XbXUGiWOaS5Cx9JmjF+I0xL1 EbBw== X-Received: by 10.68.29.2 with SMTP id f2mr35719780pbh.184.1373533949401; Thu, 11 Jul 2013 02:12:29 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id iq6sm38686996pbc.1.2013.07.11.02.12.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:12:28 -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 , Daniel Mack , Jaroslav Kysela , Takashi Iwai Subject: [PATCH 44/50] sound: usb: caiaq: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:06:07 +0800 Message-Id: <1373533573-12272-45-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: Daniel Mack Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Signed-off-by: Ming Lei Acked-by: Daniel Mack --- sound/usb/caiaq/audio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c index 7103b09..e5675ab 100644 --- a/sound/usb/caiaq/audio.c +++ b/sound/usb/caiaq/audio.c @@ -672,10 +672,11 @@ static void read_completed(struct urb *urb) offset += len; if (len > 0) { - spin_lock(&cdev->spinlock); + unsigned long flags; + spin_lock_irqsave(&cdev->spinlock, flags); fill_out_urb(cdev, out, &out->iso_frame_desc[outframe]); read_in_urb(cdev, urb, &urb->iso_frame_desc[frame]); - spin_unlock(&cdev->spinlock); + spin_unlock_irqrestore(&cdev->spinlock, flags); check_for_elapsed_periods(cdev, cdev->sub_playback); check_for_elapsed_periods(cdev, cdev->sub_capture); send_it = 1;