Hi, David, When you start the HNP, did you call the function -- usb_bus_start_enum? As you know, usb_bus_start_enum will reset the port. and according to OHCI port, if reset the port, USB_PORT_STAT_ENABLE will be set. so when we go into the following code, if ((portstatus & USB_PORT_STAT_ENABLE) && ( type != HUB_RESUME || !(portstatus & USB_PORT_STAT_CONNECTION) || !udev || udev->state == USB_STATE_NOTATTACHED)) { clear_port_feature(hdev, port1, USB_PORT_FEAT_ENABLE) portstatus &= ~USB_PORT_STAT_ENABLE; } the condition will be satisified, so we will call the clear_port_feature(hdev, port1, USB_PORT_FEAT_ENABLE). Then it will cause the port disconnected. Then OTG statemachine will be changed from B_HOST to B_PERIPHERAL. Regards Yong 2009/4/17 David Brownell <david-b@xxxxxxxxxxx>: > On Thursday 16 April 2009, Eric Miao wrote: >> > 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. >> > >> >> David, >> >> Could you let me know which exact platform and OTG driver you've >> used when you observed it was working? > > The musb_hdrc driver, in OTG mode. Working on two different > flavors of TI silicon (OMAP3, DaVinci) talking to each other > with Gadget Zero set up as the HNP test device ... so that as > soon as the a_host sees that b_device, it initiates HNP. > > (That's *with* the benefit of the HNP fixes now in Greg's > 2.6.31 merge queue.) > > One test I want to get back to is having *both* nodes be that > HNP test device. One wants to be sure it doesn't keep looping > in HNP, switching roles forever. ;) > > > And also, back in the 2.6.10 days ... OMAP 1611 H2 platforms, > talking both to each other and to the full speed OTG test > harness. I don't think that's been tested at all recently, > and so I expect some level of bitrot has set in. That was > the original test platform for all this OTG code, of course. > > - 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