From patchwork Thu Jul 11 09:06:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826150 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 515A1C0AB2 for ; Thu, 11 Jul 2013 09:14:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F99C20136 for ; Thu, 11 Jul 2013 09:14:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F0B9320121 for ; Thu, 11 Jul 2013 09:14:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932507Ab3GKJLp (ORCPT ); Thu, 11 Jul 2013 05:11:45 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:61057 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932504Ab3GKJLm (ORCPT ); Thu, 11 Jul 2013 05:11:42 -0400 Received: by mail-pb0-f45.google.com with SMTP id mc8so7663285pbc.32 for ; Thu, 11 Jul 2013 02:11:41 -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=8GSgabphrBuoQ0sq8hrMwxElQ5G8ORumXmGz4vGGrBM=; b=fz3/GOV4rW+yscOl+eNNMgnQ5kElrSpfugGUxhwe85euGh3kOUvZVt6Q3jn48Q7Fm+ QtoCg7sStp1cu81UksVR/H3/ePnCfqXosDGbmUomPxTS5/yc8imJhz6Wi+5etrFpaPkQ 0QbNtdDFm1BBbVZ9dT3QjXoMIDSZ16COLuku/e/fHVIPmgIk/ecpvy67wyPi2YiMwGWE XSkD+laV5S//Wf1ysOHHsLqKY0KTiVHTiI/FzscO2QaoFdrwuiRE+44leQhinoUxdeRq ssxVFldOzTLPTjOOOCbiLHpvVtzwamu7ip2PoBCFxFW1hpUAP0mwW9b5mbKvVQHDRfFk QTCw== X-Received: by 10.66.241.99 with SMTP id wh3mr36747179pac.141.1373533901665; Thu, 11 Jul 2013 02:11:41 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id sz6sm41102814pab.5.2013.07.11.02.11.36 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:11:40 -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 38/50] media: usb: tlg2300: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:06:01 +0800 Message-Id: <1373533573-12272-39-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=unavailable 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: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Signed-off-by: Ming Lei --- drivers/media/usb/tlg2300/pd-video.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/tlg2300/pd-video.c b/drivers/media/usb/tlg2300/pd-video.c index 8df668d..4e5bd07 100644 --- a/drivers/media/usb/tlg2300/pd-video.c +++ b/drivers/media/usb/tlg2300/pd-video.c @@ -151,11 +151,12 @@ static void init_copy(struct video_data *video, bool index) static bool get_frame(struct front_face *front, int *need_init) { struct videobuf_buffer *vb = front->curr_frame; + unsigned long flags; if (vb) return true; - spin_lock(&front->queue_lock); + spin_lock_irqsave(&front->queue_lock, flags); if (!list_empty(&front->active)) { vb = list_entry(front->active.next, struct videobuf_buffer, queue); @@ -164,7 +165,7 @@ static bool get_frame(struct front_face *front, int *need_init) front->curr_frame = vb; list_del_init(&vb->queue); } - spin_unlock(&front->queue_lock); + spin_unlock_irqrestore(&front->queue_lock, flags); return !!vb; }