From patchwork Thu Jul 11 09:06:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826109 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 8246DC0AB2 for ; Thu, 11 Jul 2013 09:11:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5522F20134 for ; Thu, 11 Jul 2013 09:11:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3393E20107 for ; Thu, 11 Jul 2013 09:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932494Ab3GKJLh (ORCPT ); Thu, 11 Jul 2013 05:11:37 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:45652 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932451Ab3GKJLe (ORCPT ); Thu, 11 Jul 2013 05:11:34 -0400 Received: by mail-pa0-f41.google.com with SMTP id bj3so7692570pad.0 for ; Thu, 11 Jul 2013 02:11:33 -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=WV0GUVl3g7xFzC94sb5KYG2HF5ya7x+Y0E7fTIFXwVg=; b=Ti2gCy3euc/y7El4bYRyuDEXcRt0iBzDaiqTz8OvN6Sw2b95qy8GqEsIjlO0Vq4+g2 F/G8GdMKX7L1uB4qIUyNRue1EU18/IjLV4kdePZ6zxyPQPOqQFGXYh9fHpqRP1JQT/bs 431SKosGOWJ0AnsXpxEQ/W+KssI5PljOPRTED3235gH3QOsLNy6GOQw9KWH5ENTvu7/P Tr5y2qu6FRRHQ4Mk5evQArd5YDxoo+Y5GXuBgG40xeOFqP/QYSqrFj07Ct6v01TBqnFO 1aTsBKfmdtL+OBVI0gkFYz48RXp6vqXvBR2jL22QhH2EZiI52AXnTEmesx3ybXkNsKUT beKg== X-Received: by 10.66.149.131 with SMTP id ua3mr22779885pab.49.1373533893686; Thu, 11 Jul 2013 02:11:33 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id qg10sm8907793pbb.2.2013.07.11.02.11.28 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:11:32 -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 37/50] media: usb: sn9x102: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:06:00 +0800 Message-Id: <1373533573-12272-38-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 change to spin_lock_irqsave(). Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Signed-off-by: Ming Lei --- 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);