aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Zickus <dzickus@redhat.com>2015-08-10 12:06:53 -0400
committerSasha Levin <sasha.levin@oracle.com>2015-10-27 22:14:45 -0400
commitc22fac8485a145a8e8b2634839c7a33bc334d16b (patch)
tree6de47604f4c0eb63a2587d0286a589c8fe02cd16
parentfb45b15c8e0666eb5500d7867394a5ddc9865655 (diff)
HID: usbhid: Fix the check for HID_RESET_PENDING in hid_io_error
[ Upstream commit 3af4e5a95184d6d3c1c6a065f163faa174a96a1d ] It was reported that after 10-20 reboots, a usb keyboard plugged into a docking station would not work unless it was replugged in. Using usbmon, it turns out the interrupt URBs were streaming with callback errors of -71 for some reason. The hid-core.c::hid_io_error was supposed to retry and then reset, but the reset wasn't really happening. The check for HID_NO_BANDWIDTH was inverted. Fix was simple. Tested by reporter and locally by me by unplugging a keyboard halfway until I could recreate a stream of errors but no disconnect. Signed-off-by: Don Zickus <dzickus@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r--drivers/hid/usbhid/hid-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index ca6849a0121e..97342ebc7de7 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -164,7 +164,7 @@ static void hid_io_error(struct hid_device *hid)
if (time_after(jiffies, usbhid->stop_retry)) {
/* Retries failed, so do a port reset unless we lack bandwidth*/
- if (test_bit(HID_NO_BANDWIDTH, &usbhid->iofl)
+ if (!test_bit(HID_NO_BANDWIDTH, &usbhid->iofl)
&& !test_and_set_bit(HID_RESET_PENDING, &usbhid->iofl)) {
schedule_work(&usbhid->reset_work);