From patchwork Thu Jul 11 09:06:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826115 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 3D937C0AB2 for ; Thu, 11 Jul 2013 09:12:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A56C20107 for ; Thu, 11 Jul 2013 09:12:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5BE0F200E0 for ; Thu, 11 Jul 2013 09:12:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932560Ab3GKJMR (ORCPT ); Thu, 11 Jul 2013 05:12:17 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:47334 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932451Ab3GKJMN (ORCPT ); Thu, 11 Jul 2013 05:12:13 -0400 Received: by mail-pb0-f44.google.com with SMTP id uo1so7640472pbc.31 for ; Thu, 11 Jul 2013 02:12:12 -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=GRTkKSqePBMrXc1QMfZHjgv06W3qkmn5PWBKUYJu160=; b=NOXdWcTMSVAbGVPvC4DFBdaxFZeVRFk3F73OHDBY/vpXS+D+vCB4cP6Dic2nOJ4SVt AuKS9/t78kxahIJwEvFDrF+/5J9n0xPnGhos4ImFFbp3Nl5wRroGfVPIxXCuX94jC283 AYNYTwDYztu9IcH1tAhTTfIemCyrmV8DwTpQFJC4PBJb7g8klAT3n7exfHnQyF25ewZ7 bkWAmIhE2qZ7e0ci7llK2p7z47o35ih/+wfmsEG8EJE/ObdpdTbJeHtMkf1PJ4i9vJ+h 6+m/OmwiDHK8RoHFSepXZIrGv3CDW3ABM+0Bl1SVIe+FearxPj/a7XLMLifFadzP94up eMPQ== X-Received: by 10.67.2.7 with SMTP id bk7mr36628179pad.50.1373533932803; Thu, 11 Jul 2013 02:12:12 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id vi8sm30068875pbc.31.2013.07.11.02.12.08 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:12:12 -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 42/50] media: usb: tlg2300: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:06:05 +0800 Message-Id: <1373533573-12272-43-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: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Signed-off-by: Ming Lei --- drivers/media/usb/tlg2300/pd-alsa.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/usb/tlg2300/pd-alsa.c b/drivers/media/usb/tlg2300/pd-alsa.c index 3f3e141..cbccc96 100644 --- a/drivers/media/usb/tlg2300/pd-alsa.c +++ b/drivers/media/usb/tlg2300/pd-alsa.c @@ -141,6 +141,7 @@ static inline void handle_audio_data(struct urb *urb, int *period_elapsed) int len = urb->actual_length / stride; unsigned char *cp = urb->transfer_buffer; unsigned int oldptr = pa->rcv_position; + unsigned long flags; if (urb->actual_length == AUDIO_BUF_SIZE - 4) len -= (AUDIO_TRAILER_SIZE / stride); @@ -156,6 +157,7 @@ static inline void handle_audio_data(struct urb *urb, int *period_elapsed) memcpy(runtime->dma_area + oldptr * stride, cp, len * stride); /* update the statas */ + local_irq_save(flags); snd_pcm_stream_lock(pa->capture_pcm_substream); pa->rcv_position += len; if (pa->rcv_position >= runtime->buffer_size) @@ -167,6 +169,7 @@ static inline void handle_audio_data(struct urb *urb, int *period_elapsed) *period_elapsed = 1; } snd_pcm_stream_unlock(pa->capture_pcm_substream); + local_irq_restore(flags); } static void complete_handler_audio(struct urb *urb)