Linux kernel USB errors -71 and -110
After an upgrade of my PC's mainboard BIOS the boot would take a minute or more to complete and sometimes the lightdm login screen would sit there but not accept keyboard input for another minute or so. Then the keyboard got enabled and I could log in normally. Everything worked fine after that bootup struggle completed. This was fully reproducible and persisted across reboots. Weird.
The kernel dmesg
log showed entries that looked suspicious:
Googleing these error -110
and error -71
is a bit hard. Now why the USB driver does not give useful error messages instead of archaic errno
-style numbers escapes me. This is not the 80s anymore.
The wisdom of the crowd says error -110
is something around "the USB port power supply was exceeded" [source].
Now lsusb -tv
shows device 1-7 ... to be my USB keyboard. I somehow doubt that wants more power than the hub is willing to provide.
The Archlinux BBS Forums recommend to piece together information from drivers/usb/host/ohci.h
and (updated from their piece which is from 2012) /tools/include/uapi/asm-generic/errno.h
. This is why some people then consider -110
to mean "Connection timed out". Nah, not likely either.
Reading through the kernel source around drivers/usb/host
did not enlighten me either. To the contrary. Uuugly. There seems to be no comprehensive list what these error codes mean. And the numbers are assigned to errors conditions quite arbitrarily. And - of course - there is no documentation. "It was hard to do, so it should be hard to understand as well."
Luckily some of the random musings I read through contained some curious advice: power cycle the host. So I did and that did not make the error go away. Other people insisted on removing cables out of wall sockets, unplugging everything and conducting esoteric rituals. That made it dawn on me, the mainboard of course nicely powers the USB in "off" state, too. So switching the power supply off (yes, these have a separate switch, go find yours), waiting a bit for capacitors to drain and switching things back on and ... the errors were gone, the system booted within seconds again.
So the takeaway message: If you get random error messages like
device not accepting address 42, error -71
on devices that previously worked fine ... completely remove power from the host, the hubs and the USB devices. So they forget they saw each other on the bus before. And when they see each other after that blackout, they will happily go through negotiating protocol details with each other again successfully.