On Sun, 26 Aug 2012, Lan Tianyu wrote:
> �� 2012/8/24 22:45, Alan Stern �:
> > On Fri, 24 Aug 2012, Lan Tianyu wrote:
> >
> >>>> But if other places got hub descriptor, they can't get DeviceRemovable
> >>>> value since we only set DeviceRemovable in the hub_configure().(e.g
> >>>> lsusb).
> >
> > Note: This isn't true. You now set desc->u.hs.DeviceRemovable in
> > ehci_hub_descriptor().
> Oh. Sorry. I maybe confuse you or make you misunderstand due to my broken
> descriptor. Do you agree set desc->u.hs.DeviceRemovable in
> ehci_hub_descriptor()?
Yes. Ideally, those bits should be set even if the hub driver isn't
bound to the root hub device.
> At the first time, the hub->maxchild is not set and port's device was not
> created so usb port has not been bound with acpi. usb port's ACPI information
> is
> not accessible at that time. The usb_get_hub_port_connect_type will return
> type_unkown.
> The value returned by first time of call get_hub_descriptor() will not be
> correct.
Now I see the problem. The code you're adding to ehci-hub.c relies on
the hub driver knowing about the root hub's ports beforehand. So
you've got a circular dependency:
ehci-hub.c depends on the hub driver knowing about the
root hub's ports;
The hub driver learns the root-hub port connectivity
information by asking ehci-hub.c.
The way to break this circle is to make ehci-hub.c use the ACPI
information directly rather than going through the hub driver's data
structures.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html