From patchwork Thu Jul 11 09:05:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826092 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 21BB49F7D6 for ; Thu, 11 Jul 2013 09:09:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16B5120107 for ; Thu, 11 Jul 2013 09:09:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D23FA200E0 for ; Thu, 11 Jul 2013 09:09:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932285Ab3GKJJU (ORCPT ); Thu, 11 Jul 2013 05:09:20 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:33889 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932278Ab3GKJJR (ORCPT ); Thu, 11 Jul 2013 05:09:17 -0400 Received: by mail-pb0-f44.google.com with SMTP id uo1so7685898pbc.17 for ; Thu, 11 Jul 2013 02:09: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=t7gnEsQtre85cGGJMSZsQLFcOvrTVoOfr8EYsswP2Qo=; b=QDBl7T2OZQa13oYenbElW3Id4WMZRaIkSAWmw9jnAbA11T21Nq6HgVNNZjAEYRllcQ qsfq99z5JPbcK+Gb4Wr1LogykdypvtEe2GFCriTIHIMZ7Bi7fv1J8JFHEllC/wpHI1r7 wYqGcRbRK7HkKyPMJnmF8FDxKfaWPS4w4BqRe9BXJonakDJ9tCuPf4f6H8dEDYikDerC aAL13hYyR7i4oahUOYliIY077YO//qQvifFoWcZVyNBUHO2pb2Zpym3AFtDELD2Epvvd 0cIkjrdz2lwzEJIrNUU7VLxlWqQz0Ggq1RiRpMJ80gTyAWyFAUZ4RShwWbde7XLRvZoV sPEw== X-Received: by 10.66.155.163 with SMTP id vx3mr26210626pab.67.1373533756892; Thu, 11 Jul 2013 02:09:16 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id ep4sm11080928pbd.35.2013.07.11.02.09.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:09:16 -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 20/50] USB: serial: usb_wwan: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:43 +0800 Message-Id: <1373533573-12272-21-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: Johan Hovold Signed-off-by: Ming Lei --- drivers/usb/serial/usb_wwan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index 8257d30..c807d65 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c @@ -312,6 +312,7 @@ static void usb_wwan_outdat_callback(struct urb *urb) struct usb_wwan_port_private *portdata; struct usb_wwan_intf_private *intfdata; int i; + unsigned long flags; port = urb->context; intfdata = port->serial->private; @@ -319,9 +320,9 @@ static void usb_wwan_outdat_callback(struct urb *urb) usb_serial_port_softint(port); usb_autopm_put_interface_async(port->serial->interface); portdata = usb_get_serial_port_data(port); - spin_lock(&intfdata->susp_lock); + spin_lock_irqsave(&intfdata->susp_lock, flags); intfdata->in_flight--; - spin_unlock(&intfdata->susp_lock); + spin_unlock_irqrestore(&intfdata->susp_lock, flags); for (i = 0; i < N_OUT_URB; ++i) { if (portdata->out_urbs[i] == urb) {