Skip to content

Commit 3af4e5a

Browse files
dzickusrhJiri Kosina
authored andcommitted
HID: usbhid: Fix the check for HID_RESET_PENDING in hid_io_error
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 <[email protected]> Cc: [email protected] Signed-off-by: Jiri Kosina <[email protected]>
1 parent a1c173d commit 3af4e5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hid/usbhid/hid-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static void hid_io_error(struct hid_device *hid)
164164
if (time_after(jiffies, usbhid->stop_retry)) {
165165

166166
/* Retries failed, so do a port reset unless we lack bandwidth*/
167-
if (test_bit(HID_NO_BANDWIDTH, &usbhid->iofl)
167+
if (!test_bit(HID_NO_BANDWIDTH, &usbhid->iofl)
168168
&& !test_and_set_bit(HID_RESET_PENDING, &usbhid->iofl)) {
169169

170170
schedule_work(&usbhid->reset_work);

0 commit comments

Comments
 (0)