Bug 51491 - hid-generic aaaa:bbbb:cccc.dddd: usage index exceeded => problem with HID_MAX_USAGES?
Summary: hid-generic aaaa:bbbb:cccc.dddd: usage index exceeded => problem with HID_MAX...
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Input Devices (show other bugs)
Hardware: All Linux
: P1 high
Assignee: Jiri Kosina
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-09 19:15 UTC by Y. G. (theYinYeti)
Modified: 2015-08-24 12:23 UTC (History)
4 users (show)

See Also:
Kernel Version: 3.6.9
Tree: Mainline
Regression: No


Attachments
cat /sys/kernel/debug/hid/0003:04D9:A081.0003/rdesc (6.55 KB, text/plain)
2013-02-26 17:50 UTC, Armin Hopp
Details
rdesc output (165.49 KB, application/octet-stream)
2013-02-26 17:57 UTC, Armin Hopp
Details
/sys/kernel/debug/hid/<device>/rdesc (with and without patch) (10.00 KB, application/x-bzip2)
2013-03-04 16:59 UTC, Y. G. (theYinYeti)
Details
rdesc from Acer Aspire Switch 10 detachable keyboard with vanilla kernel (567 bytes, application/octet-stream)
2015-02-08 11:27 UTC, Pedro
Details
rdesc (gzipped) from Acer Aspire Switch 10 detachable keyboard on modified kernel (321.03 KB, application/gzip)
2015-02-08 11:29 UTC, Pedro
Details

Description Y. G. (theYinYeti) 2012-12-09 19:15:27 UTC
I bought a König CMP-KEYPAD60, which is a multifunctional USB touchpad. It is advertised as a "plug-and-play" HID device for basic features (touchpad+keypad), and needs a driver for advanced features (gestures). In (Arch) Linux however, when the device is plugged in, it is inactive, and the logs show:

Dec  8 18:23:16 localhost kernel: [  746.429949] usb 2-2: new full-speed USB device number 3 using uhci_hcd
Dec  8 18:23:16 localhost kernel: [  746.603845] hid-generic 0003:062A:2901.0004: usage index exceeded
Dec  8 18:23:16 localhost kernel: [  746.603855] hid-generic 0003:062A:2901.0004: item 0 2 2 2 parsing failed
Dec  8 18:23:16 localhost kernel: [  746.603875] hid-generic: probe of 0003:062A:2901.0004 failed with error -22
Dec  8 18:23:16 localhost kernel: [  746.605759] hid-generic 0003:062A:2901.0005: usage index exceeded
Dec  8 18:23:16 localhost kernel: [  746.605765] hid-generic 0003:062A:2901.0005: item 0 2 2 2 parsing failed
Dec  8 18:23:16 localhost kernel: [  746.605784] hid-generic: probe of 0003:062A:2901.0005 failed with error -22

A G-search for this error showed me this single piece of information:
http://forums.opensuse.org/english/get-technical-help-here/hardware/473200-usb-gaming-mouse-04d9-a078-not-working-linux-plus-workaround.html

I compiled a new kernel, exactly identical to Arch Linux' standard kernel, with the exception of HID_MAX_USAGES changed from 12288 to 65535. Now the basic features are all working and the error messages are not there anymore. As for the advanced features, to my knowledge no driver exists...

Although I don't understand the actual nature of the change, I suggest to set HID_MAX_USAGES' value to a greater default value, since it seems that newer devices would need this.
Comment 1 Jiri Kosina 2012-12-10 14:24:42 UTC
I very much doubt that the device actually presents 64k usages. I have seen devices having such bogus information in their report descriptor, but it didn't reflect the reality.

Increasing HID_MAX_USAGES will create larger kernel memory consumption, so it'd rather be properly justified.

Otherwise we'll just have to patch the report descriptor of the device to reflect reality better.

Could you please attach output of

   cat /sys/kernel/debug/hid/<device>/rdesc

?
Comment 2 Armin Hopp 2013-02-26 17:50:04 UTC
Created attachment 94121 [details]
cat /sys/kernel/debug/hid/0003:04D9:A081.0003/rdesc

output of
cat /sys/kernel/debug/hid/0003:04D9:A081.0003/rdesc

1 of 3 hid devices registered when mouse is plugged in.

output taken from machines with patched kernel 
HID_MAX_USAGES  64000
Comment 3 Armin Hopp 2013-02-26 17:57:23 UTC
Created attachment 94131 [details]
rdesc output

output of
cat /sys/kernel/debug/hid/0003:04D9:A081.<*>/rdesc

taken for Mouse Sharkoon DarkGlider (comparable problem with exceeding HID_MAX_USAGES)

output taken from machines with kernel patched to
HID_MAX_USAGES  64000

zipped since die actual mouse registeres 32k+ Usages and plain-text exceeds file-size limit.
Comment 4 Y. G. (theYinYeti) 2013-03-04 16:59:44 UTC
Created attachment 94421 [details]
/sys/kernel/debug/hid/<device>/rdesc (with and without patch)

With patch:
0003.062A.2901.000x_patch.dmesg: devices inserted (acts as both kbd and mouse)
0003.062A.2901.000x_patch.cmds: commands that were executed and their stderr
0003.062A.2901.0007_patch.rdesc: empty... command did not work
0003.062A.2901.0008_patch.rdesc: empty... command did not work

Without patch:
0003.062A.2901.000x_nopatch.dmesg: devices inserted (acts as both kbd and mouse)
0003.062A.2901.000x_nopatch.cmds: commands that were executed and their stderr
0003.062A.2901.0005_nopatch.rdesc: requested output for first device
0003.062A.2901.0006_nopatch.rdesc: requested output for second device
Comment 5 Pedro 2015-02-08 11:27:51 UTC
Created attachment 166061 [details]
rdesc from Acer Aspire Switch 10 detachable keyboard with vanilla kernel
Comment 6 Pedro 2015-02-08 11:29:52 UTC
Created attachment 166071 [details]
rdesc (gzipped) from Acer Aspire Switch 10 detachable keyboard on modified kernel
Comment 7 Pedro 2015-02-08 11:33:08 UTC
I am running into the same bug on an convertible laptop (2 in 1) Acer Aspire Switch 10 with any kernel in the 3.16.x, 3.17.x, 3.18.x and 3.19.x series till (and including) 3.19.0.rc7. The detachable keyboard does not work with a vanilla kernel (HID_MAX_USAGES=12288)

When booting the vanilla kernel 3.19.0.rc7 (distribution Ubuntu 14.10) the following messages regarding hid-generic appear in syslog:

[    5.369778] usb 1-4.3: new full-speed USB device number 5 using xhci_hcd
[    5.473010] usb 1-4.3: New USB device found, idVendor=06cb, idProduct=2968
[    5.476694] usb 1-4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    5.479978] usb 1-4.3: Product: ITE Device(8595)
[    5.483249] usb 1-4.3: Manufacturer: ITE Tech. Inc.
[    5.492649] hid (null): usage index exceeded
[    5.496525] hid-generic 0003:06CB:2968.0002: usage index exceeded
[    5.499738] hid-generic 0003:06CB:2968.0002: item 0 2 2 2 parsing failed
[    5.502988] hid-generic: probe of 0003:06CB:2968.0002 failed with error -22

/sys/kernel/debug/hid/<device>/rdesc shown in attachment 166061 [details].

When booting a modified kernel with HID_MAX_USAGES=65536 (include/linux/hid.h) the messages in syslog change to

[    5.333717] usb 1-4.3: new full-speed USB device number 5 using xhci_hcd
[    5.437199] usb 1-4.3: New USB device found, idVendor=06cb, idProduct=2968
[    5.440569] usb 1-4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    5.443059] usb 1-4.3: Product: ITE Device(8595)
[    5.445535] usb 1-4.3: Manufacturer: ITE Tech. Inc.
[    5.463404] input: ITE Tech. Inc. ITE Device(8595) as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.3/1-4.3:1.0/0003:06CB:2968.0002/input/input2
[    5.522807] hid-generic 0003:06CB:2968.0002: input,hiddev0,hidraw1: USB HID v1.10 Keyboard [ITE Tech. Inc. ITE Device(8595)] on usb-0000:00:14.0-4.3/input0

And the keyboard works. /sys/kernel/debug/hid/<device>/rdesc (gzipped) included in attachment 166071 [details]
Comment 8 forty7 2015-08-24 12:23:30 UTC
I have the same issue with the detachable keyboard of my Medion P2213T (MD 98927). It should be the same for simular devices (probably at least all P2212T, p2213T and P2214T models)


Fedora 22 system log:
...
hid-generic: probe of 0003:04F3:0400.0002 failed with error -22
hid-generic 0003:04F3:0400.0002: item 0 2 2 2 parsing failed
hid-generic 0003:04F3:0400.0002: usage index exceeded
hid (null): usage index exceeded
...


cat /sys/kernel/debug/hid/0003:04F3:0400.0002/rdesc shows:
06 89 ff 09 10 a1 01 85 5a 09 01 15 00 26 ff 00 75 08 95 10 b1 00 c0 05 01 09 06 a1 01 85 01 75 01 95 08 05 07 19 e0 29 e7 15 00 25 01 81 02 95 01 75 08 81 03 95 05 75 01 05 08 19 01 29 05 91 02 95 01 75 03 91 03 95 06 75 08 15 00 26 ff 00 05 07 19 00 2a ff 00 81 00 c0 05 0c 09 01 a1 01 85 02 19 00 2a 3c 02 15 00 26 3c 02 75 10 95 01 81 00 c0 05 01 09 0c a1 01 85 03 15 00 25 01 09 c6 95 01 75 01 81 06 75 07 81 03 c0 05 88 09 01 a1 01 85 04 19 00 2a ff ff 15 00 26 ff ff 75 08 95 02 81 02 c0 05 01 09 80 a1 01 85 05 19 81 29 83 15 00 25 01 95 08 75 01 81 02 c0 


Jiri Kosina, I had the same issue with an Sharkoon mouse some time ago, and the mouse now works. After using google a bit I think I found the source code of the patch you applied back then, supporting a couple of gaming mice. Could we just re-use this patch with modified device ids?
http://linux-kernel.2935.n7.nabble.com/PATCH-0-2-Holtek-gaming-mouse-driver-and-the-necessity-for-it-instead-of-increasing-HID-MAX-USAGES-td653027.html
Just in case you forgot about this patch.

Note You need to log in before you can comment on or make changes to this bug.