From patchwork Sat Aug 17 16:25:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2846007 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 831AF9F2F5 for ; Sat, 17 Aug 2013 16:31:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE698201E9 for ; Sat, 17 Aug 2013 16:31:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D084201DA for ; Sat, 17 Aug 2013 16:31:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754497Ab3HQQbc (ORCPT ); Sat, 17 Aug 2013 12:31:32 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:42766 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753878Ab3HQQbb (ORCPT ); Sat, 17 Aug 2013 12:31:31 -0400 Received: by mail-pd0-f173.google.com with SMTP id p10so3384339pdj.18 for ; Sat, 17 Aug 2013 09:31:31 -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=4CDBqJ//C9GvMlcMKg6tybsr/oJquhhYscjRzvUkXqY=; b=HUBoSJHKwICEJHDZB0NzRRmuF/5lYRBo0NExtlYDU3zyLsSp1eTlYig3R0zv1XF9WW 5hJ22hI0mGrptS981awQwxH6xjMOvMUneGXzM9qIDdr5/GUiTUXw/G2NI3NVwM9KOeTo 4nys1d8qFez8CeUT9dlJY5efwdI2Bncig5sRe6vLepRoSj3NuHQ0XE6wKhpqs1OlCdSV U7tz61a7PkMwBVftujuSbvbm+ZHXcM1lIRYjQjVVFt8n2BD5imaXExAg52UMkJS2G8lG miEXgl5isL8gqHBdPQCKLmeQgx14zi+sHwejs6mZWIgQGa3L2G8O3sg5TSIPxqjL1eeh g/Yg== X-Received: by 10.68.230.106 with SMTP id sx10mr1698948pbc.170.1376757091101; Sat, 17 Aug 2013 09:31:31 -0700 (PDT) Received: from localhost ([183.37.213.217]) by mx.google.com with ESMTPSA id w8sm4835088paj.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 17 Aug 2013 09:31:30 -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 38/49] media: usb: em28xx: prepare for enabling irq in complete() Date: Sun, 18 Aug 2013 00:25:03 +0800 Message-Id: <1376756714-25479-39-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 Reviewed-by: Devin Heitmueller Tested-by: Devin Heitmueller Signed-off-by: Ming Lei Acked-by: Hans Verkuil --- drivers/media/usb/em28xx/em28xx-core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index fc157af..0d698f9 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c @@ -941,6 +941,7 @@ static void em28xx_irq_callback(struct urb *urb) { struct em28xx *dev = urb->context; int i; + unsigned long flags; switch (urb->status) { case 0: /* success */ @@ -956,9 +957,9 @@ static void em28xx_irq_callback(struct urb *urb) } /* Copy data from URB */ - spin_lock(&dev->slock); + spin_lock_irqsave(&dev->slock, flags); dev->usb_ctl.urb_data_copy(dev, urb); - spin_unlock(&dev->slock); + spin_unlock_irqrestore(&dev->slock, flags); /* Reset urb buffers */ for (i = 0; i < urb->number_of_packets; i++) {