From patchwork Thu Jul 11 09:05:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826199 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 6ABC59F756 for ; Thu, 11 Jul 2013 09:18:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F90220121 for ; Thu, 11 Jul 2013 09:18:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16835200D0 for ; Thu, 11 Jul 2013 09:18:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932174Ab3GKJIY (ORCPT ); Thu, 11 Jul 2013 05:08:24 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:41757 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932140Ab3GKJIW (ORCPT ); Thu, 11 Jul 2013 05:08:22 -0400 Received: by mail-pa0-f44.google.com with SMTP id lj1so7636965pab.3 for ; Thu, 11 Jul 2013 02:08:22 -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=F77BxDWw5xf1sQi8kX0z4wPQ1KvksEBMWoERS50HI6s=; b=V3Pfv55LEYjI56lKkHm4aFfZhY95X5An1J6B8mNlybS26ZGm4OdOCS5esRAzXtJzvQ eH3zqNNp+Vw68vbqy/CJ1FCWLYBD1//HXEU0OJRBucjoq73Z1f39EUpjCU9KYlbRlwuW Jc8sqmXZRqT16ipPATXF6p6lL6Is1or/jHGnMVZS2kwnmQbWvrXQoX+iFhg57BxwaDTu u1FfTmMROTNf3wgHOBdjpVpO9makqUkSjzQOeXGna/STOAsTad0mL0Fe99yM/4IOmv/f uREzO0JeSgXrAoToGMlJn+gX/q59UVQr+jvUd7+xulxJ6j94HS3hAMGyqaA9NxYKZDSf o+LQ== X-Received: by 10.68.143.197 with SMTP id sg5mr8851125pbb.134.1373533701977; Thu, 11 Jul 2013 02:08:21 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id zv11sm41091886pab.3.2013.07.11.02.08.17 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:08:21 -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 13/50] USB: serial: io_ti: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:36 +0800 Message-Id: <1373533573-12272-14-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/io_ti.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 60054e7..4943194 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c @@ -1615,6 +1615,7 @@ static void edge_bulk_in_callback(struct urb *urb) int retval = 0; int port_number; int status = urb->status; + unsigned long flags; switch (status) { case 0: @@ -1663,13 +1664,13 @@ static void edge_bulk_in_callback(struct urb *urb) exit: /* continue read unless stopped */ - spin_lock(&edge_port->ep_lock); + spin_lock_irqsave(&edge_port->ep_lock, flags); if (edge_port->ep_read_urb_state == EDGE_READ_URB_RUNNING) retval = usb_submit_urb(urb, GFP_ATOMIC); else if (edge_port->ep_read_urb_state == EDGE_READ_URB_STOPPING) edge_port->ep_read_urb_state = EDGE_READ_URB_STOPPED; - spin_unlock(&edge_port->ep_lock); + spin_unlock_irqrestore(&edge_port->ep_lock, flags); if (retval) dev_err(dev, "%s - usb_submit_urb failed with result %d\n", __func__, retval); }