On Wed, 8 Sep 2010, Pavan Kondeti wrote: > According to OTG 2.0 spec, B-device should observe A-device connect signal > with in 155ms (min time) after A-device suspended the bus. usb_remove_hcd > blocks till the B-device and root hub are completely disconnected (class > drivers unbind). > > ehci_irq observes the PCD interrupt and B-device disconnection is carried out > in hub thread context. Before hub thread observes, this device disconnection, > root hub device state and HW_ACCESSIBLE flag is cleared and gadget driver is > activated. Yeah. Its all looks like hacky and racy. But could not find a > better method to meet HNP timings. To do this properly, we need to have a method for quickly taking the hardware away from an OTG-compliant host controller driver. Then the root hub and everything else on the host side can be unregistered in a background thread or simply left idle. Probably this should be a new method in the hc_driver structure. Is ehci-hcd the only driver where this matters? What about musb or various versions of ohci-hcd? > > > How can we avoid autosuspend/system suspend and intrusion from > > > sysfs/debugfs without calling usb_remove_hcd? > > > > The only way would be to have the HCD check whether or not the hardware > > is in host mode before allowing it to do anything. On the whole, > > unregistering the host controller seems safer if it cannot operate > > without interfering with the device controller. > > > I agree. I am trying to submit the basic OTG driver (host/device role based on > Id pin state) first. So I will stick to usb_add_hcd() and usb_remove_hcd(). If the HCD can be prevented from touching the hardware, do you think it is still necessary to add and remove the bus? Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html