Skip to contentSkip to conversation

usbhid: discarded events don't abort idleness

PATCH Applied Oliver Neukum 2 participants 4 messages Nov 5, 2015 – Nov 23, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usbhid: discarded events don't abort idleness

If an event is discarded the device stays idle.
Just reverse the order of check and marking busy.

---
 drivers/hid/usbhid/hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/usbhid/hid-core.c +1 -1
index 36712e9..19a4364 100644
@@ -274,10 +274,10 @@ static void hid_irq_in(struct urb *urb)
 
 	switch (urb->status) {
 	case 0:			/* success */
-		usbhid_mark_busy(usbhid);
 		usbhid->retry_delay = 0;
 		if ((hid->quirks & HID_QUIRK_ALWAYS_POLL) && !hid->open)
 			break;
+		usbhid_mark_busy(usbhid);
 		if (!test_bit(HID_RESUME_RUNNING, &usbhid->iofl)) {
 			hid_input_report(urb->context, HID_INPUT_REPORT,
 					 urb->transfer_buffer,
Signature · 1 line
2.1.4
maintainer
#1 lore raw
Quoted 4 lines · Oliver Neukum

If an event is discarded the device stays idle.
Just reverse the order of check and marking busy.

Hi Oliver,

thanks for the fix. This is a real bug, so I am wondering whether you have seen causing it real problems (and hence it should be merged for 4.4), or if you found it just by code inspection (and therefore it should be fine to merge it for 4.5).

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#2 lore raw
Quoted 5 lines · Jiri Kosina
Quoted 3 lines · Oliver Neukum

If an event is discarded the device stays idle.
Just reverse the order of check and marking busy.

Quoted 8 lines
Quoted 1 line

Hi Oliver,

thanks for the fix. This is a real bug, so I am wondering whether you have seen causing it real problems (and hence it should be merged for 4.4), or if you found it just by code inspection (and therefore it should be fine to merge it for 4.5).

Hi,

I was looking for another bug. So code inspection.

HTH
Oliver