linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usbhid: call report_fixup before comparing descriptors
@ 2012-09-17 20:05 Kevin Daughtridge
       [not found] ` <50578272.1020902-ZgHIA9YJVL4@public.gmane.org>
  2012-09-18 16:16 ` Henrik Rydberg
  0 siblings, 2 replies; 4+ messages in thread
From: Kevin Daughtridge @ 2012-09-17 20:05 UTC (permalink / raw)
  To: Jiri Kosina, linux-input-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

hid_post_reset checks the stored report descriptor against what is currently
returned by the device. An HID driver's report_fixup method may have 
changed the
stored descriptor, however, creating false positives. These leave some 
devices
nonfunctional after a resume, with a "reset_resume error 1" reported. 
This patch
passes the new descriptor to the driver's report_fixup method, if any, 
before it
is compared to the stored one.

BugLink: http://bugs.launchpad.net/bugs/1049623
Signed-off-by: Kevin Daughtridge <kevin-ZgHIA9YJVL4@public.gmane.org>
---
--- a/drivers/hid/usbhid/hid-core.c    2012-08-20 10:17:09.000000000 -0700
+++ b/drivers/hid/usbhid/hid-core.c    2012-09-16 18:51:45.381868737 -0700
@@ -1436,6 +1436,10 @@ static int hid_post_reset(struct usb_int
          kfree(rdesc);
          return 1;
      }
+
+    if (hid->driver && hid->driver->report_fixup)
+        rdesc = hid->driver->report_fixup(hid, rdesc, &status);
+
      status = memcmp(rdesc, hid->rdesc, hid->rsize);
      kfree(rdesc);
      if (status != 0) {
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-19  2:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-17 20:05 [PATCH] usbhid: call report_fixup before comparing descriptors Kevin Daughtridge
     [not found] ` <50578272.1020902-ZgHIA9YJVL4@public.gmane.org>
2012-09-18 12:00   ` Sergei Shtylyov
2012-09-18 16:16 ` Henrik Rydberg
2012-09-19  2:21   ` Kevin Daughtridge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).