From patchwork Sat Aug 17 16:25: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: 2846008 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 9D1869F2F5 for ; Sat, 17 Aug 2013 16:31:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA9F7201E9 for ; Sat, 17 Aug 2013 16:31:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E631D201DA for ; Sat, 17 Aug 2013 16:31:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754506Ab3HQQbl (ORCPT ); Sat, 17 Aug 2013 12:31:41 -0400 Received: from mail-pb0-f51.google.com ([209.85.160.51]:36839 "EHLO mail-pb0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753878Ab3HQQbk (ORCPT ); Sat, 17 Aug 2013 12:31:40 -0400 Received: by mail-pb0-f51.google.com with SMTP id jt11so3236062pbb.10 for ; Sat, 17 Aug 2013 09:31:40 -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=WV0GUVl3g7xFzC94sb5KYG2HF5ya7x+Y0E7fTIFXwVg=; b=Swf1RCxxFfjuXKqCBq5dlnYpYVUwkMSZsfPRKsDtkSjAB/ds/2epf8NCZ6tEQsigz8 l2NTvTWj7la4U2RsZSrpv/SvIGrAZRTARE/Rb+Rtg2ftKpHwIHkHyDXQx07Pg6SZtERQ tk7nMAxPmQz1AJY/+Un9ODuSazK/F3SIcsTwyBgRFB/jw7Cad8VdlR8IqSEFoARb6Rgz u+U+cKYQLe9JX/qSiYLOeOPN7dq93OctXoZ7UAxMim4W5euORVjEr3UW7PB7lLh+n2sp bwo/RZl5Jer43MRTSL52qN4Hffn+2BxLMuzLmLbDSD+7aIqDsvy1vHi3r6Nn6JrP+Sma vABA== X-Received: by 10.66.50.104 with SMTP id b8mr3823978pao.39.1376757100176; Sat, 17 Aug 2013 09:31:40 -0700 (PDT) Received: from localhost ([183.37.213.217]) by mx.google.com with ESMTPSA id xl3sm4554335pbb.17.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 17 Aug 2013 09:31:39 -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 39/49] media: usb: sn9x102: prepare for enabling irq in complete() Date: Sun, 18 Aug 2013 00:25:04 +0800 Message-Id: <1376756714-25479-40-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 change to spin_lock_irqsave(). Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Signed-off-by: Ming Lei Acked-by: Hans Verkuil --- drivers/media/usb/sn9c102/sn9c102_core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/sn9c102/sn9c102_core.c b/drivers/media/usb/sn9c102/sn9c102_core.c index 2cb44de..33dc595 100644 --- a/drivers/media/usb/sn9c102/sn9c102_core.c +++ b/drivers/media/usb/sn9c102/sn9c102_core.c @@ -784,12 +784,14 @@ end_of_frame: cam->sensor.pix_format.pixelformat == V4L2_PIX_FMT_JPEG) && eof)) { u32 b; + unsigned long flags; b = (*f)->buf.bytesused; (*f)->state = F_DONE; (*f)->buf.sequence= ++cam->frame_count; - spin_lock(&cam->queue_lock); + spin_lock_irqsave(&cam->queue_lock, + flags); list_move_tail(&(*f)->frame, &cam->outqueue); if (!list_empty(&cam->inqueue)) @@ -799,7 +801,8 @@ end_of_frame: frame ); else (*f) = NULL; - spin_unlock(&cam->queue_lock); + spin_unlock_irqrestore(&cam->queue_lock, + flags); memcpy(cam->sysfs.frame_header, cam->sof.header, soflen);