From patchwork Thu Jul 11 09:06:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826114 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 074DA9F756 for ; Thu, 11 Jul 2013 09:12:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E1DA52010E for ; Thu, 11 Jul 2013 09:12:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B6AAD20107 for ; Thu, 11 Jul 2013 09:12:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932547Ab3GKJMK (ORCPT ); Thu, 11 Jul 2013 05:12:10 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:52842 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932451Ab3GKJMF (ORCPT ); Thu, 11 Jul 2013 05:12:05 -0400 Received: by mail-pb0-f44.google.com with SMTP id uo1so7688418pbc.17 for ; Thu, 11 Jul 2013 02:12:05 -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=n0ZyefOsK2o2xCrRRRbbXDTucruINSYb4nTcDq98OLU=; b=bFpqFGONM8+KkK59i6k/I2ZFv8QISXY8X+Snc1qMWDvPwutQfT2daGhg+rNp3ZYpDO +uxkkNS5SGqEgvZdnuMhg9TC32cLJz+Ky6vur5+hhPipCc7cGnPAGjRh0F5SF/i+QNv/ KTrEaMsyThfl2PVXKiJ6CtIy7rbSPSsA79fgn4UpP928POr1SAFNtje9j3CI5sRE65el VD1PO7VOChQBfycCOBkT5VY1+p+GZnRYoxdnHxk/YOpB51yzSjBMe1YXhZsZ/dLkx4zb 90uoEXNumPY1N12Knu5ludcLolfbdes2SCMgANf69hcc0tS20Ur50yubLwGYo/aoWUIc jNjg== X-Received: by 10.66.155.163 with SMTP id vx3mr26220931pab.67.1373533925036; Thu, 11 Jul 2013 02:12:05 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id td4sm41054499pac.20.2013.07.11.02.12.00 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:12:04 -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 , Mauro Carvalho Chehab Subject: [PATCH 41/50] media: usb: em28xx: make sure irq disabled before acquiring lock Date: Thu, 11 Jul 2013 17:06:04 +0800 Message-Id: <1373533573-12272-42-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 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 --- drivers/media/usb/em28xx/em28xx-audio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c index 2fdb66e..dca53ec 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,6 +135,7 @@ static void em28xx_audio_isocirq(struct urb *urb) length * stride); } + local_irq_save(flags); snd_pcm_stream_lock(substream); dev->adev.hwptr_done_capture += length; @@ -151,6 +153,7 @@ static void em28xx_audio_isocirq(struct urb *urb) } snd_pcm_stream_unlock(substream); + local_irq_restore(flags); } if (period_elapsed) snd_pcm_period_elapsed(substream);