aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-07-19 16:08:54 -0400
committerJiri Kosina <jkosina@suse.cz>2012-07-20 05:24:25 -0400
commitd4150c8f3d80b4a9387083478a86da8b3390dd83 (patch)
tree8a7dd3e89587dc3f986dc83c2ce40e91a96dac24 /drivers
parentf2b5264d4f77328e45d73cd135772b6e88a4951a (diff)
HID: usbhid: check for suspend or reset before restarting
This patch (as1596) improves the queue-restart logic in usbhid by checking to see if the device is suspended or a reset is about to occur. There's no point submitting an URB if either of those is true. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Oliver Neukum <oliver@neukum.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hid/usbhid/hid-core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 271578b85d9..4309c03038f 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -207,7 +207,8 @@ static int usbhid_restart_out_queue(struct usbhid_device *usbhid)
207 int kicked; 207 int kicked;
208 int r; 208 int r;
209 209
210 if (!hid) 210 if (!hid || test_bit(HID_RESET_PENDING, &usbhid->iofl) ||
211 test_bit(HID_SUSPENDED, &usbhid->iofl))
211 return 0; 212 return 0;
212 213
213 if ((kicked = (usbhid->outhead != usbhid->outtail))) { 214 if ((kicked = (usbhid->outhead != usbhid->outtail))) {
@@ -245,7 +246,8 @@ static int usbhid_restart_ctrl_queue(struct usbhid_device *usbhid)
245 int r; 246 int r;
246 247
247 WARN_ON(hid == NULL); 248 WARN_ON(hid == NULL);
248 if (!hid) 249 if (!hid || test_bit(HID_RESET_PENDING, &usbhid->iofl) ||
250 test_bit(HID_SUSPENDED, &usbhid->iofl))
249 return 0; 251 return 0;
250 252
251 if ((kicked = (usbhid->ctrlhead != usbhid->ctrltail))) { 253 if ((kicked = (usbhid->ctrlhead != usbhid->ctrltail))) {