From patchwork Thu Jul 11 09:05:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826088 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 C20BBC0AB2 for ; Thu, 11 Jul 2013 09:09:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 94EAF2011B for ; Thu, 11 Jul 2013 09:09:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DBBF3200B9 for ; Thu, 11 Jul 2013 09:09:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932244Ab3GKJI5 (ORCPT ); Thu, 11 Jul 2013 05:08:57 -0400 Received: from mail-pb0-f48.google.com ([209.85.160.48]:52199 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932090Ab3GKJIy (ORCPT ); Thu, 11 Jul 2013 05:08:54 -0400 Received: by mail-pb0-f48.google.com with SMTP id ma3so7637275pbc.21 for ; Thu, 11 Jul 2013 02:08:53 -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=NF79LKXXJgjTfVBf4glwqqqGGBbUhagRs2py1Uz9NQc=; b=ZSa4ukqWrnBRDvb7LZqoI0p8nb+g1onkg6e2amiAiJKQKllojJFKCglhG8CuqGbhDf zuTmWqLT/GutDgdnyDYKA7Yp7LT4ydTuaYk3GiL2hxOpFsxENYWkv6fUXQj9di/Sl2nN NOudJJWa9Ew3BOu/iMaKZXSAmTwNeGej4r9bLwDmrjaMIrBxWGftJq7ni6cMqwg0ulyI A2djjRGApLkkdqsE0wG0933krEVe9Ug896VVk7xNv9ivezMj4DAGRaKHSAXyBtfMtCdP 2sCr1uf2t1ihlFibiPVzgCRxZOD6jIvOKrk082kc6btc4V7nx3UDmxZKXuzZ/Xq5gbEW Bs8Q== X-Received: by 10.68.252.36 with SMTP id zp4mr35929160pbc.51.1373533733780; Thu, 11 Jul 2013 02:08:53 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id y9sm38606399pbb.46.2013.07.11.02.08.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:08:52 -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 , Johan Hovold Subject: [PATCH 17/50] USB: serial: sierra: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:40 +0800 Message-Id: <1373533573-12272-18-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: Johan Hovold Signed-off-by: Ming Lei --- drivers/usb/serial/sierra.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index de958c5..e79b6ad 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -433,6 +433,7 @@ static void sierra_outdat_callback(struct urb *urb) struct sierra_port_private *portdata = usb_get_serial_port_data(port); struct sierra_intf_private *intfdata; int status = urb->status; + unsigned long flags; intfdata = port->serial->private; @@ -443,12 +444,12 @@ static void sierra_outdat_callback(struct urb *urb) dev_dbg(&port->dev, "%s - nonzero write bulk status " "received: %d\n", __func__, status); - spin_lock(&portdata->lock); + spin_lock_irqsave(&portdata->lock, flags); --portdata->outstanding_urbs; - spin_unlock(&portdata->lock); - spin_lock(&intfdata->susp_lock); + spin_unlock_irqrestore(&portdata->lock, flags); + spin_lock_irqsave(&intfdata->susp_lock, flags); --intfdata->in_flight; - spin_unlock(&intfdata->susp_lock); + spin_unlock_irqrestore(&intfdata->susp_lock, flags); usb_serial_port_softint(port); }