From patchwork Thu Jul 11 09:05:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826192 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 AD01BC0AB3 for ; Thu, 11 Jul 2013 09:17:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DB1820134 for ; Thu, 11 Jul 2013 09:17:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7062F20107 for ; Thu, 11 Jul 2013 09:17:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932258Ab3GKJJJ (ORCPT ); Thu, 11 Jul 2013 05:09:09 -0400 Received: from mail-pb0-f53.google.com ([209.85.160.53]:50089 "EHLO mail-pb0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932090Ab3GKJJC (ORCPT ); Thu, 11 Jul 2013 05:09:02 -0400 Received: by mail-pb0-f53.google.com with SMTP id xb12so7701567pbc.12 for ; Thu, 11 Jul 2013 02:09:01 -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=zaLrupR2YlVbwQYUJGobYa7ltV5ZiwcjVQ5VBs64k10=; b=MCmViAJyLcCaMkjP9f5g88NBReiNMyBzve1b2aHXHGlKKL0f/NV+Rt1KyY1bTOOcyw ju71SvPZLJb92a3IRsq8v3FobTjpzczXSAEYHNPNT/mN+XLCX/hbXGzx2K3TnhPeCeQJ MBfMH8fAsvr3+TdtAWAxC3TUsjMdObCot71seInX2eKMl0MmbaHrXvd60igmMNjulKFl s749eNDBFKmkKzD28m+kdVBz2rTWirB6AE2JyMMMviCk2nfCobEKQ6IUjyBVw+RO14yp 6E/qem+7cDTQof5ieLKgQ3aMjUyaZxghvjLAd8rn8zKT16a1C5FFBxDYDunUW2J9e9QX U02g== X-Received: by 10.68.224.66 with SMTP id ra2mr3563010pbc.41.1373533741400; Thu, 11 Jul 2013 02:09:01 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id ep4sm11079569pbd.35.2013.07.11.02.08.56 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:09:00 -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 18/50] USB: serial: symbolserial: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:41 +0800 Message-Id: <1373533573-12272-19-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/symbolserial.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c index 9b16489..b4f5cbe 100644 --- a/drivers/usb/serial/symbolserial.c +++ b/drivers/usb/serial/symbolserial.c @@ -41,6 +41,7 @@ static void symbol_int_callback(struct urb *urb) int status = urb->status; int result; int data_length; + unsigned long flags; switch (status) { case 0: @@ -81,7 +82,7 @@ static void symbol_int_callback(struct urb *urb) } exit: - spin_lock(&priv->lock); + spin_lock_irqsave(&priv->lock, flags); /* Continue trying to always read if we should */ if (!priv->throttled) { @@ -92,7 +93,7 @@ exit: __func__, result); } else priv->actually_throttled = true; - spin_unlock(&priv->lock); + spin_unlock_irqrestore(&priv->lock, flags); } static int symbol_open(struct tty_struct *tty, struct usb_serial_port *port)