diff mbox

usbhid: discarded events don't abort idleness

Message ID 1446724527-27736-1-git-send-email-oneukum@suse.com (mailing list archive)
State Accepted
Delegated to: Jiri Kosina
Headers show

Commit Message

Oliver Neukum Nov. 5, 2015, 11:55 a.m. UTC
If an event is discarded the device stays idle.
Just reverse the order of check and marking busy.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/hid/usbhid/hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jiri Kosina Nov. 20, 2015, 10 a.m. UTC | #1
On Thu, 5 Nov 2015, Oliver Neukum wrote:

> If an event is discarded the device stays idle.
> Just reverse the order of check and marking busy.
> 
> Signed-off-by: Oliver Neukum <oneukum@suse.com>

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,
Oliver Neukum Nov. 23, 2015, 9:17 a.m. UTC | #2
On Fri, 2015-11-20 at 11:00 +0100, Jiri Kosina wrote:
> On Thu, 5 Nov 2015, Oliver Neukum wrote:
> 
> > If an event is discarded the device stays idle.
> > Just reverse the order of check and marking busy.
> > 
> > Signed-off-by: Oliver Neukum <oneukum@suse.com>
> 
> 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



--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jiri Kosina Nov. 23, 2015, 2:47 p.m. UTC | #3
On Thu, 5 Nov 2015, Oliver Neukum wrote:

> If an event is discarded the device stays idle.
> Just reverse the order of check and marking busy.
> 
> Signed-off-by: Oliver Neukum <oneukum@suse.com>

Applied to for-4.5/core. Thanks,
diff mbox

Patch

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 36712e9..19a4364 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -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,