From patchwork Thu Jul 11 09:05:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826084 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 BA7A29F7D6 for ; Thu, 11 Jul 2013 09:08:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DA872011B for ; Thu, 11 Jul 2013 09:08:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6ADAF200B9 for ; Thu, 11 Jul 2013 09:08:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932210Ab3GKJIm (ORCPT ); Thu, 11 Jul 2013 05:08:42 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:54503 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932170Ab3GKJIi (ORCPT ); Thu, 11 Jul 2013 05:08:38 -0400 Received: by mail-pa0-f51.google.com with SMTP id lf11so7670514pab.24 for ; Thu, 11 Jul 2013 02:08:37 -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=S0ybI6GG06wGd/3GXeQeF2BfUI/AoJ4qLxjPl6q+Byo=; b=U400JhChszxcnKi1RLRQJz2A7kg3I+SYAXX1+2WWBfatoRIJAQ6mk7pcu2BZMXzboq eRgXntr+Wb6W1kcPySKLgwTu6wW+V4Js9kwDDkx8p3T3gw+SvM9fA4y+z/xbUDHcHQM7 2CwQI9tqKmYrjcS5155XbYdbG65AuLhjK9Pp/i5fqFSnPxzV/GYQxM3UHGi9irhEimyI tt71TAzp0JiL44HG1FwT7qPwZDp/U29du40+F00Dve0jNDssLN9l2LzEeuoEgN0fCi+7 gwu2Dp2d5/Yj05z7aT99E9iqfjCaG8bHJDWFxJMwE/BN9xrADmIG98Q8krIOUXUKPi2w iXCg== X-Received: by 10.66.119.74 with SMTP id ks10mr37493211pab.179.1373533717650; Thu, 11 Jul 2013 02:08:37 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id br1sm38662951pbb.4.2013.07.11.02.08.32 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:08:36 -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 15/50] USB: serial: mos77840: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:38 +0800 Message-Id: <1373533573-12272-16-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/mos7840.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 0a818b2..f21dcd0 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -788,17 +788,18 @@ static void mos7840_bulk_out_data_callback(struct urb *urb) struct usb_serial_port *port; int status = urb->status; int i; + unsigned long flags; mos7840_port = urb->context; port = mos7840_port->port; - spin_lock(&mos7840_port->pool_lock); + spin_lock_irqsave(&mos7840_port->pool_lock, flags); for (i = 0; i < NUM_URBS; i++) { if (urb == mos7840_port->write_urb_pool[i]) { mos7840_port->busy[i] = 0; break; } } - spin_unlock(&mos7840_port->pool_lock); + spin_unlock_irqrestore(&mos7840_port->pool_lock, flags); if (status) { dev_dbg(&port->dev, "nonzero write bulk status received:%d\n", status);