From patchwork Thu Jul 11 09:06:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826124 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 1A8DE9F756 for ; Thu, 11 Jul 2013 09:13:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E5A5020134 for ; Thu, 11 Jul 2013 09:13:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B66A220107 for ; Thu, 11 Jul 2013 09:13:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932695Ab3GKJNU (ORCPT ); Thu, 11 Jul 2013 05:13:20 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:38698 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932611Ab3GKJNR (ORCPT ); Thu, 11 Jul 2013 05:13:17 -0400 Received: by mail-pa0-f52.google.com with SMTP id kq13so7617602pab.25 for ; Thu, 11 Jul 2013 02:13:16 -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=obozjZcQxcUIvkz0iA458u20kEhBSNpeLnMnCtRrew8=; b=G7o4Fdz6d7dQxAiTpuMerYpCSgmdHRg3yuxIghSsn/oTL4gRMFv5SeRAycDuQPGeT6 PK3OyRzTmcm3aKOAf+uNfyc7kuqNEeoOsgO17CyT0iynRNcKKLqL+j9jR6V9NO8ROndx Ahc1lAPaGkWls2TvVHXypT2hyyfKw+54TljC2CyfNPKvH8LiZA8gw4tTD4fkxiZ8fEaJ lcVbUVX8lacX2dlPFZWgj8kt9ZAL47GnLD0r4lTwoupOlLGMiAmM649xYsfEuCKgKJlw 7ab4GBvIeYlh3mmB6c4q0Rg28zww4QjnS2pMh+nqWsc9wyf4iv1xLwY4sL2nVDeXEJgC R28g== X-Received: by 10.68.197.136 with SMTP id iu8mr35517925pbc.183.1373533996584; Thu, 11 Jul 2013 02:13:16 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id ry2sm38583569pbc.41.2013.07.11.02.13.11 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:13:15 -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 , devel@driverdev.osuosl.org Subject: [PATCH 50/50] staging: vt6656: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:06:13 +0800 Message-Id: <1373533573-12272-51-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: devel@driverdev.osuosl.org Signed-off-by: Ming Lei --- drivers/staging/vt6656/usbpipe.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c index 098be60..0282f2e 100644 --- a/drivers/staging/vt6656/usbpipe.c +++ b/drivers/staging/vt6656/usbpipe.c @@ -485,6 +485,7 @@ static void s_nsBulkInUsbIoCompleteRead(struct urb *urb) int bIndicateReceive = false; int bReAllocSkb = false; int status; + unsigned long flags; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsBulkInUsbIoCompleteRead\n"); status = urb->status; @@ -515,18 +516,18 @@ static void s_nsBulkInUsbIoCompleteRead(struct urb *urb) STAvUpdateUSBCounter(&pDevice->scStatistic.USB_BulkInStat, status); if (bIndicateReceive) { - spin_lock(&pDevice->lock); + spin_lock_irqsave(&pDevice->lock, flags); if (RXbBulkInProcessData(pDevice, pRCB, bytesRead) == true) bReAllocSkb = true; - spin_unlock(&pDevice->lock); + spin_unlock_irqrestore(&pDevice->lock, flags); } pRCB->Ref--; if (pRCB->Ref == 0) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"RxvFreeNormal %d \n",pDevice->NumRecvFreeList); - spin_lock(&pDevice->lock); + spin_lock_irqsave(&pDevice->lock, flags); RXvFreeRCB(pRCB, bReAllocSkb); - spin_unlock(&pDevice->lock); + spin_unlock_irqrestore(&pDevice->lock, flags); } return;