From patchwork Sat Aug 17 16:25:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2846012 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 4866D9F2F5 for ; Sat, 17 Aug 2013 16:32:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6938E201E9 for ; Sat, 17 Aug 2013 16:32:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 94207201DA for ; Sat, 17 Aug 2013 16:32:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754536Ab3HQQcT (ORCPT ); Sat, 17 Aug 2013 12:32:19 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:45229 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753706Ab3HQQcS (ORCPT ); Sat, 17 Aug 2013 12:32:18 -0400 Received: by mail-pd0-f174.google.com with SMTP id y13so3379645pdi.19 for ; Sat, 17 Aug 2013 09:32:17 -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:in-reply-to:references; bh=ia8vn5EhNnm/3tQFFscOxFLfis/LB42TGMt1/brcw40=; b=GBy54ZlRpE1lB2kDhJ4Lp5xEjTVTuvR29KwhTxG/VBOu1ohQKsT3UTtZVU0F9+WTYa Rd7ig/DX6/qjyl4IItWmxdnwUTGKmXhWhvRuZxbAzBUtZqkyCDzuJ576ftdXFrX29CJ2 ZZMbQA4bBwkij0o0KHLv2vWFaTUy0XDIysMKwZRWaLEpz+byiNy3walRH2a9Hj845fo9 XsXfPdAs5R0nqZ1p/V/O7S74pCkx2uS//B3RnDmfbeKdyicslFbRTP1LVcMyPZ5RwQjB IzauBTdrqAIPR9aK9t3mzMA9r9YM3rGOz21N4Cl4jrLrRsgk/ltYVPoUpQLyQOrgOmdy jzfA== X-Received: by 10.66.228.234 with SMTP id sl10mr2528952pac.149.1376757137887; Sat, 17 Aug 2013 09:32:17 -0700 (PDT) Received: from localhost ([183.37.213.217]) by mx.google.com with ESMTPSA id x8sm4538680pbb.39.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 17 Aug 2013 09:32:16 -0700 (PDT) From: Ming Lei To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Oliver Neukum , Alan Stern , Ming Lei , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [PATCH v1 43/49] media: usb: em28xx: prepare for enabling irq in complete() Date: Sun, 18 Aug 2013 00:25:08 +0800 Message-Id: <1376756714-25479-44-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1376756714-25479-1-git-send-email-ming.lei@canonical.com> References: <1376756714-25479-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=-9.6 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 add local_irq_save() before acquiring the lock without irqsave(). Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Signed-off-by: Ming Lei Acked-by: Hans Verkuil --- drivers/media/usb/em28xx/em28xx-audio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c index 2fdb66e..7fd1b2a 100644 --- a/drivers/media/usb/em28xx/em28xx-audio.c +++ b/drivers/media/usb/em28xx/em28xx-audio.c @@ -113,6 +113,7 @@ static void em28xx_audio_isocirq(struct urb *urb) stride = runtime->frame_bits >> 3; for (i = 0; i < urb->number_of_packets; i++) { + unsigned long flags; int length = urb->iso_frame_desc[i].actual_length / stride; cp = (unsigned char *)urb->transfer_buffer + @@ -134,7 +135,7 @@ static void em28xx_audio_isocirq(struct urb *urb) length * stride); } - snd_pcm_stream_lock(substream); + snd_pcm_stream_lock_irqsave(substream, flags); dev->adev.hwptr_done_capture += length; if (dev->adev.hwptr_done_capture >= @@ -150,7 +151,7 @@ static void em28xx_audio_isocirq(struct urb *urb) period_elapsed = 1; } - snd_pcm_stream_unlock(substream); + snd_pcm_stream_unlock_irqrestore(substream, flags); } if (period_elapsed) snd_pcm_period_elapsed(substream);