From: Ming Lei <ming.lei@canonical.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, Oliver Neukum <oliver@neukum.org>,
Alan Stern <stern@rowland.harvard.edu>,
Ming Lei <ming.lei@canonical.com>, Jiri Kosina <jkosina@suse.cz>,
linux-input@vger.kernel.org
Subject: [PATCH v1 23/49] hid: usbhid: prepare for enabling irq in complete()
Date: Sun, 18 Aug 2013 00:24:48 +0800 [thread overview]
Message-ID: <1376756714-25479-24-git-send-email-ming.lei@canonical.com> (raw)
In-Reply-To: <1376756714-25479-1-git-send-email-ming.lei@canonical.com>
Complete() will be run with interrupt enabled, so change to
spin_lock_irqsave().
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: linux-input@vger.kernel.org
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
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 bd38cdf..2445fd6 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);
}
--
1.7.9.5
next prev parent reply other threads:[~2013-08-17 16:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-17 16:24 [PATCH v1 00/49] USB: prepare for enabling irq in complete() Ming Lei
2013-08-17 16:24 ` Ming Lei [this message]
2013-08-22 12:19 ` [PATCH v1 23/49] hid: usbhid: " Ming Lei
2013-08-26 11:44 ` Jiri Kosina
2013-08-17 16:24 ` [PATCH v1 26/49] input: cm109: " Ming Lei
2013-08-18 3:37 ` Dmitry Torokhov
2013-08-18 14:10 ` Ming Lei
2013-08-18 18:05 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1376756714-25479-24-git-send-email-ming.lei@canonical.com \
--to=ming.lei@canonical.com \
--cc=gregkh@linuxfoundation.org \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oliver@neukum.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).