On Wednesday 15 April 2009, yao yong wrote: > > This is a lot better than the previous patch. I wonder if there is a > > simple way to eliminate the ugly preprocessor test. For instance, if > > CONFIG_USB_OTG isn't defined, won't hdev->bus->is_b_host always be 0? > > [Yong] As I know, only OTG device will change the is_b_host. But I > think we may reserve this preprecessor in order to align with the > previous code. We can trust is_b_host as Alan suggests, yes. But I'm not entirely sure this patch is correct. Does this affect some of the OTG conformance tests? I've certainly observed HNP to proceed through b_host enumerating an a_peripheral (after the role switch) with the current code. Of course, the fact that I've seen it work *could* be caused by bugs in the drivers I was working with. > > I also wonder if this is truly correct. Evidently you want the new > > behavior to apply during the HNP exchange, but what about at other > > times? Suppose the device is already a B-host when its root hub gets > > suspended; what would happen then? > > [Yong] when root hub gets suspended, port will disconnect. In such > case, otg state machine will change from OTG_STATE_B_HOST to > OTG_STATE_B_PERIPHERAL. At that time, the B device will be back as the > peripheral. we don't use host port any more. And there are three other events that can trigger transitions from B_HOST ... all of those are hardware signals though. Two of them can cause B_IDLE transitions. - Dave -- 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