On Sun, 13 Oct 2013, yoma sophian wrote: > >> if so, how driver decide to use which hcd when Super/Non-Super speed > >> devices plug in? > > > > Simple: When a SuperSpeed device plugs in, the driver uses the > > SuperSpeed hcd. When a non-SuperSpeed device plugs in, the driver uses > > the non-SuperSpeed hcd. :-) > in handle_port_status, we use major_revision to choose correct hcd, > then find port_array. > then I cannot see any benefit to make 2 hcds. We use two hcd structures because there are two physical buses. > BTW, why in xhci we choose HCD with USB2 as major? Because the low/full/high-speed bus is registered first and the SuperSpeed bus is registered second. I forget the reason why it gets done this way, but there is a good reason. Maybe you can find it in the mailing list archives. Or you can ask the xHCI maintainer. > > Remember, it's possible that the hibernate transition might fail. If > > it does fail, we want the controller to return to the same state it had > > before, not to be reset. > Yes, you are right. > if we just reset controller each time for hibernate transition, that > mean controller has no chance back to normal state when hibernate > transition is fail. > > But why don't we just add error handling in xhci_suspend instead of > calling bus spend for hibernate transition? I don't understand your question. Remember, even for hibernation we want to do an orderly shutdown of the USB buses. This means we should call the bus_suspend routine. Also, it is not guaranteed that the platform will remove all power when the system goes into hibernation. x86 platforms do this, but SoC platforms might not. For this reason, we want to put the controller into low-power mode at the start of hibernation. 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