From patchwork Thu Jul 11 09:05:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826185 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 44142C0AB2 for ; Thu, 11 Jul 2013 09:17:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 29E2720107 for ; Thu, 11 Jul 2013 09:17:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D29C200D0 for ; Thu, 11 Jul 2013 09:17:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932290Ab3GKJJ3 (ORCPT ); Thu, 11 Jul 2013 05:09:29 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:64331 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932259Ab3GKJJZ (ORCPT ); Thu, 11 Jul 2013 05:09:25 -0400 Received: by mail-pa0-f45.google.com with SMTP id bi5so7611324pad.18 for ; Thu, 11 Jul 2013 02:09:24 -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=0Y033hjVxaOLc/gjiPNTKL0aoq1pfe+Cyq5t3lIgorQ=; b=DWTsUaHx6cqIKzUaaT0RH0U+z/brAUp0BuGYv9FLfaG+oydO4DCpdnxj2rlMkwDYwt d0twpw1j7rAiDfJr0ExXhTleRhc14TxrsvMUOlrf9XIs4b+9wGfgN5f3bSxlueNSzoea g6CZAdp1sQgayjfbGznZ54hMFguED9u/whlsXMZ8tPMhap445CXKRmoi0pw/h/I+yrAA eE6sz2HoDGyol+e9JgxsLNdCRCSRaqDWAzJiv/gx7pz6q1rTBKiNWwqEY5fCnpC4XkFA gRnTbwlbL0eTD4SRynd4Cz/6Evemnpr+TaiLOlZyhiSNt9C8nikoQ0j3FW9uT8NyUH9f PTCA== X-Received: by 10.66.182.166 with SMTP id ef6mr36482547pac.35.1373533764742; Thu, 11 Jul 2013 02:09:24 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id ne6sm34189268pbc.28.2013.07.11.02.09.20 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:09:23 -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 , Jiri Kosina Subject: [PATCH 21/50] hid: usbhid: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:44 +0800 Message-Id: <1373533573-12272-22-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: Jiri Kosina Cc: linux-input@vger.kernel.org Signed-off-by: Ming Lei --- drivers/hid/usbhid/hid-core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 9941828..e1d8518 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -489,8 +489,9 @@ static void hid_ctrl(struct urb *urb) struct hid_device *hid = urb->context; struct usbhid_device *usbhid = hid->driver_data; int unplug = 0, status = urb->status; + unsigned long flags; - spin_lock(&usbhid->lock); + spin_lock_irqsave(&usbhid->lock, flags); switch (status) { case 0: /* success */ @@ -525,7 +526,7 @@ static void hid_ctrl(struct urb *urb) } clear_bit(HID_CTRL_RUNNING, &usbhid->iofl); - spin_unlock(&usbhid->lock); + spin_unlock_irqrestore(&usbhid->lock, flags); usb_autopm_put_interface_async(usbhid->intf); wake_up(&usbhid->wait); }