summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorWilliam Wu <william.wu@rock-chips.com>2019-03-15 10:00:15 +0800
committerTao Huang <huangtao@rock-chips.com>2019-03-15 18:34:28 +0800
commitef409c6d47a0bdc40f763ecc63d4f5178594d007 (patch)
tree3485228ff0287a36fb966303e65180d8f1f1eb35 /arch
parentafd36f12503ae8dcde5e2ce509faeba9d86c985d (diff)
usb: dwc3: rockchip: fix connect fail when force host mode
The DWC3 rockchip driver provides a sysfs interface "dwc3_mode" to force Peripheral mode or Host mode. It has a problem to force to Host mode when the DWC3 works as Peripheral mode and connects to Host (e.g. PC USB Port). This issue can be reproduced on RK1808 EVB follow these steps: 1. Set dr_mode = "otg" in DTS dwc3 node; 2. Start the system, and connect the RK1808 USB 3.0 to PC USB. 3. Make sure that PC has recognized the USB device, and then force DWC3 to Host mode via "dwc3_mode". echo "host" > /sys/devices/platform/usb/dwc3_mode And plug in an USB 2.0 Device to RK1808 USB 3.0 Port, then we can see the following error log: rockchip-dwc3 usb: Peripheral disconnect timeout rockchip-dwc3 usb: USB unconnectedxhci-hcd xhci-hcd.3.auto: xHCI Host Controller xhci-hcd xhci-hcd.3.auto: new USB bus registered, assigned bus number 3 xhci-hcd xhci-hcd.3.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x04010010 ... hub 4-0:1.0: USB hub found hub 4-0:1.0: 1 port detected rockchip-dwc3 usb: USB HOST connected rockchip-dwc3 usb: set new mode successfully usb 3-1: new high-speed USB device number 2 using xhci-hcd usb 3-1: new high-speed USB device number 3 using xhci-hcd usb usb3-port1: attempt power cycle usb 3-1: new full-speed USB device number 4 using xhci-hcd usb 3-1: Device not responding to setup address usb 3-1: Device not responding to setup address usb 3-1: device not accepting address 4, error -71 It's because that in this test case, the dr_mode is original otg mode, and the current code only call phy_set_mode() to disconnect the peripheral from PC host if the dr_mode is peripheral mode. This cause dwc3_rockchip_otg_extcon_evt_work() wait peripheral disconnect timeout, and DWC3 fail to do runtime suspend and resume to initialized the DWC3 core register again. This patch call phy_set_mode() to disconnect the peripheral if the current dr_mode is peripheral or otg when force to host mode. Change-Id: I733d364046abcb616cf3d99ed57ab8604a87eef6 Signed-off-by: William Wu <william.wu@rock-chips.com>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions