-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kernel 4.9.x crash using USB composite gadget HID function #1943
Comments
The 4.4 is the current stable tree for raspbian. |
This issue affects all versions of 4.9 - it may be fixed in 4.11, but there are other issues with that release. Expected fix: 749494b |
@mame82 are you able to build kernel from source? |
Unfortunately I haven't got the time to do this in the next weeks (even I would like to in my own interest). Maybe I could ask somebody to test the patch. I'll report back |
A colleague of mine is willing to test the patch tommorow. Could you provide a starting point (tutorial) on cross compiling and deploying the firmware binaries to RPi to save him some time? I'm sure he is able to do this on its own, but not without initial guidance (newcomer on ARM, but Linux expert otherwise) |
I think if you run |
@popcornmix thanks for the links. @markusschultheis agreed to dive into this tommorow. I myself had to revert to kernel 4.4.50+, because as said I'm currently working on a major release of a Pi project relying on usb_f_hid (time is running and I need it working for now) |
BTW. I looked into the newer kernel, because of another bug in current USB_f_rndis.ko. Reconnecting the Pi makes the detected bitrate drop from 425Mbps to 0Mbps. A description of the problem is here. I haven't opened an issue for this, because I patched the module binary, but had hopes that it would be gone in newer release |
@mame82 @popcornmix What is the current status of this one? |
I'm waiting to hear is the usb_f_hid.ko I posted helps the issue. |
@popcornmix
|
I had success using the posted module, but only after getting the same kernel version by using |
@BlanketFortGames so you are happy with test module and it fixes the crash for you? @Fyren here is modules that should work with latest rpi-update kernel (4.9.36): @pelwell okay with including upstream patch (749494b) in 4.9 tree? |
No objections from me. |
I am happy with the test module. The original one fixed the crash for kernel 4.9.19, and the new one fixes the crash on 4.9.36. Thank you for your help. |
@popcornmix Thanks. The module also seems to work for me. It does not crash when creating a HID and the hid_gadget_test sample in the kernel docs works for sending keyboard reports. |
Okay pushed to rpi-4.9.y branch. Will be in next rpi-update kernel. |
kernel: usb: gadget: f_hid: fix: Move IN request allocation to set_alt() See: raspberrypi/linux#1943 kernel: overlays: Add gpio-shutdown overlay See: raspberrypi/linux#2103 kernel: config: enable generic S/PDIF codec drivers See: raspberrypi/linux#2104 kernel: drm/vc4: firmwarekms DPMS support See: raspberrypi/linux#2102
kernel: usb: gadget: f_hid: fix: Move IN request allocation to set_alt() See: raspberrypi/linux#1943 kernel: overlays: Add gpio-shutdown overlay See: raspberrypi/linux#2103 kernel: config: enable generic S/PDIF codec drivers See: raspberrypi/linux#2104 kernel: drm/vc4: firmwarekms DPMS support See: raspberrypi/linux#2102
Hey guys, So there're two questions left:
One more Thing: as mentioned earlier in this issue the RNDIS composite device (usb_f_rndis.ko) gets detected with a bitrate of 0 bps after unplugging and replugging the Pi to a Windows 10 64bit host. Unfortunately this issue still resides in kernel 4.9.39+. So again ... many thanks for fixing the HID gadget problem, great community !!! Keep on going |
Hi - is there a single file copy/headless solution for this? Can I just drop in a file mentioned above into a particular location? I have serial console going via a bus pirate. I can easily download the file on my mac, copy it to /boot. Then I can boot the Pi and manually copy the file into its final location (and reboot again). |
No - in general a kernel module built for a different kernel version won't load. |
@popcornmix - thanks - I suspected that might be an issue. I'll do the rpi-update on Pi 2 that I have with keyboard, hdmi, and network. |
A little thank you from the red teaming world, for fixing this module |
Closing this issue as questions answered/issue resolved. |
usb_f_hid.ko
crashes onhidg_bind
, when callingalloc_ep_req
.Code causing the issue is here
Possible patch is described here but marked with "revert"
Could you please Point out what is the latest kernel with working HID Composite Gadget function (I was on 4.4.50+ before testing latest kernel)
The text was updated successfully, but these errors were encountered: