From patchwork Thu Jul 11 09:05:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826087 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 099CDC0AB2 for ; Thu, 11 Jul 2013 09:09:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E0E79200B9 for ; Thu, 11 Jul 2013 09:08:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B82652011B for ; Thu, 11 Jul 2013 09:08:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932220Ab3GKJIs (ORCPT ); Thu, 11 Jul 2013 05:08:48 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:49564 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932090Ab3GKJIq (ORCPT ); Thu, 11 Jul 2013 05:08:46 -0400 Received: by mail-pa0-f50.google.com with SMTP id fb1so7566890pad.23 for ; Thu, 11 Jul 2013 02:08:45 -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=vZw972tT//wk6zbqp9sWOh34X4Om5Q7gvP13ffQdSZE=; b=O/8blMZRMzAFjEIBscWLSYK3G/enuEPtKSsTJ7fyhijHCE14+gx9q2oOUCuOWA7zZL KJvA3YkTxKXoYIMQMDBTa4xPOaRBCYu35ARPyWLR8acuNwXCvhBRFLAWFiCCddbiVU5Y vwUkDxUrNUD8NKA/C5TmxErC/FiK6LgqLKYr19vFu8ScQ7bS4uo7gnZkBG9fnoluI9A5 ARvZXr7aaSkHg4NDqMIjGSPJ0ro2hKSyqThTZheLfRPczWDZ1J7j5Js83Os+UWx9c9Aa PquK1y7BF+U7Vu4lvseo2C6hi9HUsImWpdTZoh2Hwd2PBgCqsnXUxwrQIjHmvbbI734+ qgIw== X-Received: by 10.68.36.132 with SMTP id q4mr35722904pbj.118.1373533725573; Thu, 11 Jul 2013 02:08:45 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id re16sm41051911pac.16.2013.07.11.02.08.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:08:44 -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 16/50] USB: serial: quatech2: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:39 +0800 Message-Id: <1373533573-12272-17-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/quatech2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c index d997432..95e5dbf 100644 --- a/drivers/usb/serial/quatech2.c +++ b/drivers/usb/serial/quatech2.c @@ -630,16 +630,17 @@ static void qt2_write_bulk_callback(struct urb *urb) { struct usb_serial_port *port; struct qt2_port_private *port_priv; + unsigned long flags; port = urb->context; port_priv = usb_get_serial_port_data(port); - spin_lock(&port_priv->urb_lock); + spin_lock_irqsave(&port_priv->urb_lock, flags); port_priv->urb_in_use = false; usb_serial_port_softint(port); - spin_unlock(&port_priv->urb_lock); + spin_unlock_irqrestore(&port_priv->urb_lock, flags); }