From patchwork Thu Jul 11 09:05:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826187 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 239659F756 for ; Thu, 11 Jul 2013 09:17:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B547620134 for ; Thu, 11 Jul 2013 09:17:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 84532200D0 for ; Thu, 11 Jul 2013 09:17:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932270Ab3GKJJM (ORCPT ); Thu, 11 Jul 2013 05:09:12 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:42188 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932259Ab3GKJJJ (ORCPT ); Thu, 11 Jul 2013 05:09:09 -0400 Received: by mail-pa0-f48.google.com with SMTP id kp12so7631387pab.35 for ; Thu, 11 Jul 2013 02:09:09 -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=IlhcYbj0Bk5JvXMC/dslvamuHRl6vSFsMp5e8wVsUag=; b=edq/wvf5mddOJ9yu/X0QS4+aW0KWTBYlgspAI0e9t7ZmLKnv/LNc80Kxclq1nkhZYS dSu5NWK0ANG+Vj6RutjWEd/BSlpEisGZHeEdz5qEqsSQss+JLHOrNvVJzFVNREx4VB2Y 7xP5XDjMh684f3GiW0QNnkw0957jOzgEmxLatjYLCxIUwpPxC8Y/Vx/MhQ/eTTktA2d8 a+8uBanIG/LAW61rPoXoMIl5/IoKoj5M+VAj8G8y9Y6/jIwf0Ly1UJWFmRg9kpMsHja6 BUrnsGtIWv02q2Bb67hE987sZbYloxov3GHxPKaI3JHJzmHRawcxXc77HeT8N6Ft6DgJ 4NvA== X-Received: by 10.66.166.232 with SMTP id zj8mr37424455pab.139.1373533749081; Thu, 11 Jul 2013 02:09:09 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id tr10sm7404889pbc.22.2013.07.11.02.09.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:09:08 -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 19/50] USB: serial: ti_usb_3410_5052: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:42 +0800 Message-Id: <1373533573-12272-20-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/ti_usb_3410_5052.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 7182bb7..4b984e9 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c @@ -1081,6 +1081,7 @@ static void ti_bulk_in_callback(struct urb *urb) struct device *dev = &urb->dev->dev; int status = urb->status; int retval = 0; + unsigned long flags; switch (status) { case 0: @@ -1116,20 +1117,20 @@ static void ti_bulk_in_callback(struct urb *urb) __func__); else ti_recv(port, urb->transfer_buffer, urb->actual_length); - spin_lock(&tport->tp_lock); + spin_lock_irqsave(&tport->tp_lock, flags); port->icount.rx += urb->actual_length; - spin_unlock(&tport->tp_lock); + spin_unlock_irqrestore(&tport->tp_lock, flags); } exit: /* continue to read unless stopping */ - spin_lock(&tport->tp_lock); + spin_lock_irqsave(&tport->tp_lock, flags); if (tport->tp_read_urb_state == TI_READ_URB_RUNNING) retval = usb_submit_urb(urb, GFP_ATOMIC); else if (tport->tp_read_urb_state == TI_READ_URB_STOPPING) tport->tp_read_urb_state = TI_READ_URB_STOPPED; - spin_unlock(&tport->tp_lock); + spin_unlock_irqrestore(&tport->tp_lock, flags); if (retval) dev_err(dev, "%s - resubmit read urb failed, %d\n", __func__, retval);