From patchwork Thu Jul 11 09:05:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826228 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 78C60C0AB2 for ; Thu, 11 Jul 2013 09:19:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 52AA7200D0 for ; Thu, 11 Jul 2013 09:19:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3989C20107 for ; Thu, 11 Jul 2013 09:19:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755907Ab3GKJGs (ORCPT ); Thu, 11 Jul 2013 05:06:48 -0400 Received: from mail-pb0-f50.google.com ([209.85.160.50]:41678 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755838Ab3GKJGo (ORCPT ); Thu, 11 Jul 2013 05:06:44 -0400 Received: by mail-pb0-f50.google.com with SMTP id wz7so7695519pbc.9 for ; Thu, 11 Jul 2013 02:06:44 -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=sxAx5hHNe0dziCkRpoM6HiN9NXa/A4WvXOtJ/dM4/no=; b=TIDkUdHNxdGkrg4pHl5zGchfOjjHp2Bq1cS7EwXiCJOi8nJvm8ZfeMazdIfZcT/cf1 O0pQ0+UwazawYpYYMblx5pWBgOOC+i9amLh7e/2KU5jfuEjw8u6sPidkBUXxh1T+Ko03 fvTUMznYzQZbwGdQJfAcQemxm3q9WiTBWbfasKoZ5WBbvZxvxM8KEldt9FsJmuQ6ZfFD yjgPk1oxb1uMRwyyJwh1FGxEL7kOYU8ZseY9ubWzT01Fdb8tGKwhMJOIc8F1tv11a6H3 alztJe0t16MdX0xObc4bL/PkG8NV6v0ZHPT3fm+gGlcDMgXoP7kI75e2MWYE+0dSJvsh PFrw== X-Received: by 10.66.231.103 with SMTP id tf7mr37711382pac.154.1373533604164; Thu, 11 Jul 2013 02:06:44 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id bs3sm38602720pbc.42.2013.07.11.02.06.39 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:06:43 -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 Subject: [PATCH 01/50] USB: devio: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:24 +0800 Message-Id: <1373533573-12272-2-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: Alan Stern Signed-off-by: Ming Lei --- drivers/usb/core/devio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 0598650..21e6ec6 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -495,8 +495,9 @@ static void async_completed(struct urb *urb) u32 secid = 0; const struct cred *cred = NULL; int signr; + unsigned long flags; - spin_lock(&ps->lock); + spin_lock_irqsave(&ps->lock, flags); list_move_tail(&as->asynclist, &ps->async_completed); as->status = urb->status; signr = as->signr; @@ -518,7 +519,7 @@ static void async_completed(struct urb *urb) if (as->status < 0 && as->bulk_addr && as->status != -ECONNRESET && as->status != -ENOENT) cancel_bulk_urbs(ps, as->bulk_addr); - spin_unlock(&ps->lock); + spin_unlock_irqrestore(&ps->lock, flags); if (signr) { kill_pid_info_as_cred(sinfo.si_signo, &sinfo, pid, cred, secid);