> > Rather than constantly allocating and re-allocating urb-private > > data as each request gets down to the HCD, it'd seem simpler > > to just preallocate it -- once, inside the URB. "uhci" would seem > > to want 64 bytes (on 32bit hardware), the other drivers much less. > > (While usb-ohci currently wants variable length data there, it's not > > often even half that size.) Faster too. > > I agree, this is a good solution.
OK, so here's a patch that does that. Modifies all standard
HCDs: ehci-hcd, uhci, usb-ohci, usb-uhci.
It's against 2.4.19-pre2 but it should be brought over to 2.5
soonish (after more testing). It started against pre3, but that
wouldn't boot for me -- applies there with fuzz. I did sanity
testing with each of the HCDs (enumerate/use a disk).
Previously the HCDs used urb->hcpriv for two purposes,
and both are accounted for in this patch.
- To hold urb-specific HCD data, now handled by
a preallocated urb->data buffer (no dynamic alloc
needed for this data any more).
- As a flag for whether the HCD owned the URB, now
handled by a new urb->transfer_flags bit. (Strictly
speaking, this probably shouldn't be needed, but
getting rid of such tests would be risky.)
With urb->hcpriv now gone, the CRIS code will need the
obvious tweaks, as will any HCDs that aren't in the kernel.
The notable problem is that for some reason the OHCI root
hub doesn't seem to get disconnected any more, so if you
try to "rmmod" that driver it's oopsville. I'm tracking down
why that is, but I thought it was time for other folk to see this
patch. (And for lunch ... :) And the usb-uhci driver is rather
convoluted in some ways, it's worth a closer look.
- Dave
hcpriv-0314.patch
Description: Binary data
