On Tue, Feb 21, 2012 at 10:55:17AM -0500, Alan Stern wrote: > On Tue, 21 Feb 2012, Pavan Kondeti wrote: > > > Summary of the problem: > > > > OTG driver monitors VBUS and ID lines. When VBUS is valid & ID is float, > > it activates gadget by calling usb_gadget_vbus_connect() API. When Id is > > grounded, OTG should activate HCD. But there is no standard USB core API > > for this. Some MSM SoC has ci13xxx USB controller in which host and > > device share the same register address space. To make > > sure that HCD never access (via sysfs/debugfs & runtime PM/system PM) > > hardware when peripheral mode is active, we unload HCD (usb_remove_hcd). > > When Id is groundedm HCD is loaded by calling usb_add_hcd(). This works > > great for Micro-A/B cable connect and disconnect. But we can not meet > > HNP (Host Negotiation Protocol i.e switching to host mode from > > peripheral mode) timings. > > > > As per my knowledge, dwc has separate address space for host and gadget. > > So we might not need to completely load/unload HCD. But we should have > > an API in USB core or struct hc_driver to notify host that it is no > > longer active. But if we don't unload HCD completely, khubd exists for > > root hub and will be running for every system resume cycle. I am not > > sure of side-effects of it. > > We ought to be able to inactivate the HCD by setting the root hub to > configuration 0 and then suspending it with wakeup disabled. That will > take khubd out of the picture. The HCD would have to avoid enabling > any interrupt sources in this situation. Also, a little work would be > needed to avoid resuming the root hub during every system resume cycle, > but it wouldn't be too hard. Yes, the xHCI driver would have to make sure it disables the wakeon bits. In a semi-related note, I've been meaning to track down why my Panther Point system boots when I unplug a USB device from the root port after shutdown. I think the xHCI shutdown method isn't disabling the wakeon bits, although it should have stopped the host controller, so I'm not sure why it's waking the system up... Sarah Sharp -- 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