From patchwork Thu Jul 11 09:05:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826171 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 057F69F756 for ; Thu, 11 Jul 2013 09:16:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D5D9620107 for ; Thu, 11 Jul 2013 09:16:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 363AD200D0 for ; Thu, 11 Jul 2013 09:16:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932343Ab3GKJKJ (ORCPT ); Thu, 11 Jul 2013 05:10:09 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:42051 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932278Ab3GKJKG (ORCPT ); Thu, 11 Jul 2013 05:10:06 -0400 Received: by mail-pd0-f176.google.com with SMTP id t12so7269486pdi.35 for ; Thu, 11 Jul 2013 02:10:06 -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=6wxQP927PEH/BRlwtXYE1FnUTzJtjwS5B6Nx7O84qxc=; b=GePzpw9DrQbI11oor7iUb8+eeVMTmKpgXl5nJmMq4PTbr+B38+NrowFxfYRw/cNTIv 5T9BZz4EaXpy4vSsrGTKRKJrxD/7vy9BkHOVUe8s6BDK827Fr5Is2wm8lUD413vqDLwP o7uxDjiQPYX8jteBNovtpZ8/mUNjSXqmf8KD4fbNK4MZXESu6vndoEMlrGq/4bxV/ZIj hgs+St4PBpWEaocK8xH48rVqSCkH0juArsQ/8F9HX2qF1Xulwl/kY2yqxl1JfHu8mNrh vLJEBbszwxOZ4UpKI3D0Q3fM+XbgdWXyhj2M0jiv3WlWye1O1yng2LPUiOcYsdPVUoa9 X3+Q== X-Received: by 10.66.50.104 with SMTP id b8mr37764427pao.39.1373533806077; Thu, 11 Jul 2013 02:10:06 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id ix3sm38626319pbc.37.2013.07.11.02.10.01 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:10:05 -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 Subject: [PATCH 26/50] USBNET: cdc-phonet: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:49 +0800 Message-Id: <1373533573-12272-27-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: netdev@vger.kernel.org Signed-off-by: Ming Lei --- drivers/net/usb/cdc-phonet.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c index 7d78669..413ec32 100644 --- a/drivers/net/usb/cdc-phonet.c +++ b/drivers/net/usb/cdc-phonet.c @@ -99,6 +99,7 @@ static void tx_complete(struct urb *req) struct net_device *dev = skb->dev; struct usbpn_dev *pnd = netdev_priv(dev); int status = req->status; + unsigned long flags; switch (status) { case 0: @@ -115,10 +116,10 @@ static void tx_complete(struct urb *req) } dev->stats.tx_packets++; - spin_lock(&pnd->tx_lock); + spin_lock_irqsave(&pnd->tx_lock, flags); pnd->tx_queue--; netif_wake_queue(dev); - spin_unlock(&pnd->tx_lock); + spin_unlock_irqrestore(&pnd->tx_lock, flags); dev_kfree_skb_any(skb); usb_free_urb(req);