From patchwork Thu Jul 11 09:05:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826166 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 D35929F756 for ; Thu, 11 Jul 2013 09:16:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B78F820107 for ; Thu, 11 Jul 2013 09:16:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9280A200D0 for ; Thu, 11 Jul 2013 09:16:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932383Ab3GKJK0 (ORCPT ); Thu, 11 Jul 2013 05:10:26 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:44382 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932278Ab3GKJKW (ORCPT ); Thu, 11 Jul 2013 05:10:22 -0400 Received: by mail-pa0-f53.google.com with SMTP id tj12so7589671pac.40 for ; Thu, 11 Jul 2013 02:10:21 -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=G+OPIWCJxrx2LxGDh5rRXFt8wIbD2A7HdFWt5AqlZEM=; b=Gtq1ABy2w5C68Y9BFWIiNHn4fpEbKWtMrg9b9pOtgS53EAHtwwC48IoIXuHaUHz3VH rcc+2OvfR7AgwlfzNzRjqD1W/RuPMuDo5M765XmeCeNE1es4q/aZqIW1nEUDtVRmBZJv XvCUeZRDWr7bIJM9Hni2ZDHUI1unDQyOKZkPo806HTpyHqBrrhhLT65Hhm5qzJWKL9+Z mFEJlurJvVBou2YIpjwKzKzTTnprg8+lFMGg6ommufBePsPBOguMxVTZO097zu2/6qna QWPZpvogtaY3gP4R2YBpuTFC0RwHzUlKeesuAij8hI68gcV6MWoPhbqIOcS0yAUO9hG4 WIDw== X-Received: by 10.68.217.137 with SMTP id oy9mr35593667pbc.130.1373533821342; Thu, 11 Jul 2013 02:10:21 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id tr10sm7410267pbc.22.2013.07.11.02.10.17 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:10:20 -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 28/50] USBNET: kaweth: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:51 +0800 Message-Id: <1373533573-12272-29-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/kaweth.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index afb117c..4addbbf 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c @@ -598,6 +598,7 @@ static void kaweth_usb_receive(struct urb *urb) struct kaweth_device *kaweth = urb->context; struct net_device *net = kaweth->net; int status = urb->status; + unsigned long flags; int count = urb->actual_length; int count2 = urb->transfer_buffer_length; @@ -630,12 +631,12 @@ static void kaweth_usb_receive(struct urb *urb) kaweth->stats.rx_errors++; dev_dbg(dev, "Status was -EOVERFLOW.\n"); } - spin_lock(&kaweth->device_lock); + spin_lock_irqsave(&kaweth->device_lock, flags); if (IS_BLOCKED(kaweth->status)) { - spin_unlock(&kaweth->device_lock); + spin_unlock_irqrestore(&kaweth->device_lock, flags); return; } - spin_unlock(&kaweth->device_lock); + spin_unlock_irqrestore(&kaweth->device_lock, flags); if(status && status != -EREMOTEIO && count != 1) { dev_err(&kaweth->intf->dev,