On Friday 22 April 2005 2:16 pm, Alan Stern wrote: > On Fri, 22 Apr 2005, David Brownell wrote: > > > There's sort of a chicken/egg problem there. It "should" be easy to > > have the root hub creation pulled out of the HCDs, but it's not very > > obvious how to decouple its registration from its activation. I've > > always been annoyed by how that's done, but until recently we've been > > pretty much stuck with how Linux 2.2 did this ... ;) > > Well, if the root hub is created before its activation (i.e., before > hcd->driver->start) and not registered until afterward, that should > decouple everything satisfactorily, right?
If an IRQ comes in before the root hub is "live" in usbcore, that would need to behave. It's clearly safe to register while the HCD has locked things and blocked the IRQ; not clearly safe to do it later... > > > Both ehci-hcd.c and ohci-hcd.c include the root-hub code in > > > two different pathways. It appears that the restart paths > > > (every time except the first) can pretty much ignore the > > > root hub. Is that correct? (But then why does ehci-hcd set > > > udev->state to USB_STATE_CONFIGURED?) > > > > The issue is that "re"start _is_ a start(), except fhat first time. > > > > I think the deal with EHCI is that sometimes it does a full reset > > in the restart() path, and that'd be trouble since usbcore expects > > that the root hub is still configured (like all other hubs) on resume. > > Yes. I just don't see any reason for setting the state to CONFIGURED, > since that's what it should be already. It would have been, before the reset. When you reset a device, it can't stay in the CONFIGURED state. (But maybe details changed since then...) > > > ohci-hcd and sl811-hcd include a call to hub_set_power_budget. > > > It's not clear where the call should end up. Should the > > > power-budget value be stored in the struct usb_hcd, where > > > usb_add_hcd will be able to see it? > > > > That'd probly be a better solution, yes. It's really awkward where > > it is now ... and there's an annoying window where it's set wrong. > > Basically it's a board-specific thing that should be set up before > > the root hub gets activated. > > Looking more closely, it appears that hub_set_power_budget does nothing > but adjust a value that's derived from the hub descriptor in the first > place. So if the HCDs would report the correct value for bHubContrCurrent > from the start then nothing more would be needed. There'd need to be a special case though; hubs don't have a power budget unless they're bus-powered. Ergo the awkwardness. - Dave > I'll work on a patch over the weekend. > > Alan Stern > > ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel