On Thu, Mar 19, 2015 at 11:11:17AM +0800, Li Jun wrote: > HNP polling is a mechanism which allows the OTG device currently acting as host > to determine when the other attached OTG device wishes to take the host role. > When an OTG host, which supports HNP, is connected to an OTG peripheral which > also supports HNP it shall poll the peripheral regularly to determine whether > it requires a role-swap and grant this at the earliest opportunity. > > changes for v4: > - Add OTG HNP capable check for connected device before sending HNP polling > in patch 3/8. > - Add comment to explain HNP test update in chipidea.txt in patch 8/8. > - Fix some typo. > - Add Peter's Ack in patch 1,2,4,5,6,7/8 of the series. > Have a test with your patch set, one problem has been found, for how to re-produce: - Connect USB cable and MicroAB cable between two boards - Boot up two boards - load g_mass_storage at B-device side, the enumeration will success, and A will see a usb mass-storage device - load g_mass_storage at A-device side, the problem has occurred, the connection will be lost at the beginning, then connect again. See below log: root@imx6sxsabresd:~# modprobe g_mass_storage file=/dev/mmcblk0p1 [ 19.311974] Number of LUNs=8 [ 19.314903] Mass Storage Function, version: 2009/09/11 [ 19.320192] LUN: removable file: (no medium) [ 19.324520] Number of LUNs=1 [ 19.327888] LUN: file: /dev/mmcblk0p1 [ 19.331568] Number of LUNs=1 [ 19.336831] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11 [ 19.343817] g_mass_storage gadget: userspace failed to provide iSerialNumber [ 19.350912] g_mass_storage gadget: g_mass_storage ready root@imx6sxsabresd:~# [ 19.396639] usb 1-1: USB disconnect, device number 2 [ 19.423829] sd 0:0:0:0: [sda] Synchronizing SCSI cache [ 19.430245] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK [ 19.446612] usb 1-1: Get one byte OTG status failed [ 19.735877] usb 1-1: new high-speed USB device number 3 using ci_hdrc [ 19.887394] usb 1-1: Dual-Role OTG device on HNP port [ 19.905834] usb-storage 1-1:1.0: USB Mass Storage device detected [ 19.912812] usb-storage 1-1:1.0: Quirks match for vid 0525 pid a4a5: 10000 [ 19.922080] scsi host1: usb-storage 1-1:1.0 [ 20.927712] scsi 1:0:0:0: Direct-Access Linux File-Stor Gadget 0400 PQ: 0 ANSI: 2 [ 20.956936] sd 1:0:0:0: [sda] 1024000 512-byte logical blocks: (524 MB/500 MiB) [ 21.069069] sd 1:0:0:0: [sda] Write Protect is off [ 21.179176] sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 21.420525] sda: [ 21.649297] sd 1:0:0:0: [sda] Attached SCSI disk > changes for v3: > - Move otg status selector definition from otg-fsm.h to ch9.h > - Use delayed_work instead of timer work to avoid a workstruct > - Add a new flag hnp_polling_support in usb_gadget to indicate if HNP polling > is supported, which should be set by controller driver. > - Add a new patch to enable hnp_polling_support for chipidea otg fsm drier. > - Move otg status selector hanlding from chipidea udc driver to composite.c > - Add a new patch to bypass otg status selector hanlding. > > changes for v2: > - Move HNP polling timer from chipidea controller driver to usb-otg-fsm.c to > make it more generically, then HNP polling can be fully handled by otg fsm > driver. > - Add comments for host_request_flag in patch: > usb: gadget: add host_requestf_flag in usb_gadget for OTG HNP > > Li Jun (8): > usb: gadget: add hnp_polling_support and host_request_flag in > usb_gadget > usb: add OTG status selector definition for HNP polling > usb: common: otg-fsm: add HNP polling support > usb: chipidea: udc: bypass otg status selector request handling to > gadget driver > usb: gadget: composite: handle otg status selector request from OTG > host > usb: chipidea: otg: set host_request_flag for gadget > usb: chipidea: otg: enable HNP polling support for gadget > Documentation: usb: chipidea: Update test procedure for HNP polling > > Documentation/usb/chipidea.txt | 11 ++--- > drivers/usb/chipidea/otg_fsm.c | 14 +++++- > drivers/usb/chipidea/udc.c | 3 +- > drivers/usb/common/usb-otg-fsm.c | 92 ++++++++++++++++++++++++++++++++++++++ > drivers/usb/gadget/composite.c | 25 +++++++---- > include/linux/usb/gadget.h | 6 +++ > include/linux/usb/otg-fsm.h | 13 ++++++ > include/uapi/linux/usb/ch9.h | 2 + > 8 files changed, 151 insertions(+), 15 deletions(-) > > -- > 1.7.9.5 > -- Best Regards, Peter Chen -- 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