Jump to content

hid-generic hangs on keyboard plug: usb_submit_urb(ctrl) failed


pytony
 Share

Recommended Posts

  • Funtoo Linux Developer

Hi everybody,

 

I'm currently working on improving my kernel and I figured out (taking a look at dmesg) that hid-generic keeps hanging on 10 secondes because of my keyboard (which causes by system to boot up within 15s instead of 5 :( )

 

I made lots of tests, plug, unplug, switch USB port, try with another computer. I always get the same error and the 10s timeout.

[  172.067760] usb 1-1.2: new low-speed USB device number 4 using ehci-pci
[  172.171664] usb 1-1.2: New USB device found, idVendor=1a2c, idProduct=0021
[  172.171674] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  172.171679] usb 1-1.2: Product: USB Keykoard
[  172.171683] usb 1-1.2: Manufacturer: USB
[  172.175537] input: USB USB Keykoard as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/0003:1A2C:0021.0003/input/input20
[  172.177877] hid-generic 0003:1A2C:0021.0003: input,hidraw2: USB HID v1.10 Keyboard [USB USB Keykoard] on usb-0000:00:1a.0-1.2/input0
[  182.176726] hid-generic 0003:1A2C:0021.0004: usb_submit_urb(ctrl) failed: -1
[  182.176770] hid-generic 0003:1A2C:0021.0004: timeout initializing reports
[  182.177265] input: USB USB Keykoard as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.1/0003:1A2C:0021.0004/input/input21
[  182.177800] hid-generic 0003:1A2C:0021.0004: input,hidraw3: USB HID v1.10 Device [USB USB Keykoard] on usb-0000:00:1a.0-1.2/input1

It sounds like two keyboards are detected when I plug it on. The first screws up and times out, and the second works fine. And indeed, I have to keyboards in /dev/input/by-id/

 

I googled for usb_submit_urb(ctrl) but only found old issues on 2.6 kernel.

 

I found one workaround : https://bbs.archlinux.org/viewtopic.php?pid=1500574#p1500574 but I am a bit reticent about this since I don't even understand what it means nor what it is supposed to do actually.

 

Any idea on what I could do on the kernel or on udev to fix this?

 

Thanks

Link to comment
Share on other sites

Hehehe.  15 seconds instead of 5  :P  What would the neighbors think if they knew?

Here in the ghetto we wouldn't worry about such, but I do comprehend the workaround (I think).

Staubsauger is using:

GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=376b974a-9cc7-4a48-9e6a-de19471107f2 usbhid.quirks=0x1B1C:0x1B12:0x20000000 quiet splash"

The only part of that relevant to your issue is the usbhid.quirks statement.  So in boot.conf you would add:

params += usbhid.quirks=0x1A2C:0x0021:0x20000000

To any other parameters you have.  Take a deep breath, buckle your seatbelt & give 'er a boot after doing boot-update!  Hold on to your hat.  I don't know about the 0x20000000 option, you'll have to dig into the kernel documentation on usbhid quirks, I see also some people use 0x04 (ignore) and others.  Worst case scenario: it doesn't help, so you've got nothing to lose.

I did find though that this fellow came up with what may be a more elegant solution for a similar situation:

http://ubuntuforums.org/showthread.php?t=1161574&p=8512485#post8512485

Using udev rules instead.  Just be sure to note that he posted that 6 years ago, the udev rule syntax has changed since, in particular using SYSFS, don't.  You'll have to come up with that on your own, udev makes my head hurt.

Link to comment
Share on other sites

  • Funtoo Linux Developer

Yeah, it worked with that usbhid.quirks thing. :) I won't have to buy another keyboard to get my computer boot faster. :P

 

However I'm more interested in the udev solution. I'll dig into it.

 

Thanks!

Link to comment
Share on other sites

  • Funtoo Linux Developer

My hardware is far from being F1 stuff, but I enjoy tweaking my kernel. :P I don't have any initramfs, desktop manager or such things either. XD

 

Actually this is 5s until mounting /home. Then it's a bit slower:

[    4.956638] XFS (sdb1): Mounting V4 Filesystem
[    5.072782] XFS (sdb1): Ending clean mount
[    5.364787] ip (591) used greatest stack depth: 12888 bytes left
[    5.959298] mount (666) used greatest stack depth: 12760 bytes left
[    6.050238] Adding 2097148k swap on /dev/sda2.  Priority:-1 extents:1 across:2097148k SS
[    6.698498] touch (945) used greatest stack depth: 12712 bytes left
[    9.724836] random: nonblocking pool is initialized
[   11.304092] r8169 0000:04:00.0 eth0: link down
[   11.304117] r8169 0000:04:00.0 eth0: link down
[   11.304133] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   16.382966] r8169 0000:04:00.0 eth0: link up
[   16.382977] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

But I'm sure I can reach 5s until login prompt. I don't really need swap and I could run some rc services (such as net) in background after the login prompt is displayed on the tty. I don't know if such a runlevel "after default, in background" is scriptable though...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...