USB HCD driver

Simon Arlott simon at
Sun Jun 3 14:06:37 EDT 2012

I'm giving up on writing a USB HCD driver.

There's no specification on how to use the hardware, only a mountain of
documentation on the driver itself which is needlessly full of wrappers
making it very difficult to understand what it's actually doing.

I've looked the v16 version of the APM driver and they don't appear to
know what they're doing, e.g.

	BUG_ON(count > 10000);

I'm trying to get it to compile on ARM. The fact that the patches are
still failing after 16 revisions may have more to do with inability to
identify unacceptable code than the structure of the code itself.

I'm not sure Samsung are capable of writing the HCD driver either:

This could really use some attention from someone with enough USB
experience to understand what the original driver is really doing in
order to rewrite it.

I have some code in my rpi-usb branch that can identify the hardware,
reset and then enable the host port. It's not perfect as I was trying to
determine how it worked first so there's some unnecessary locking and
likely unnecessary long term storage of config data in places.

There are some quirks around resetting the port that the original driver
ignored completely by using a blocking msleep(). My version allows the
USB subsystem to wait for the required delay before checking the status.

I'm also still not convinced that the port interrupt is necessary as
Linux only ever polls the root port for status updates but it's not
clear when usb_hcd_poll_rh_status() should be used.

Simon Arlott

More information about the linux-rpi-kernel mailing list