Hi Mani, Could you please test the patch ([PATCH] usb: dwc2: Fix host exit from hibernation flow.) which should fix issue seen on your setup and provide feedback. Meantime we will debug issue reported by John Stultz, which is another case/scenario. Regards, Artur On 5/22/2018 22:45, Manivannan Sadhasivam wrote: > + John Stultz. > > John submitted a patch recently to temporarily fix the issue by disabling the > power down feature in Hikey. > > https://urldefense.proofpoint.com/v2/url?u=https-3A__lkml.org_lkml_2018_5_21_730&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=9hPBFKCJ_nBjJhGVrrlYOeOQjP_HlVzYqrC_D7niMJI&m=6LhexoM7WPYJCGKz9Ht2lFT0FTJGYReuH-DLADH3jTk&s=T5DKo2-Jt1vCbo1Tq0MsuktMrpJ-GnxKCigx58tKqrw&e= > > John, I have listed some of my findings to this thread which will help > debugging the issue. > > Thanks, > Mani > > On Thu, May 17, 2018 at 04:04:01PM +0530, Manivannan Sadhasivam wrote: >> Hi Artur, >> >> Thanks for the reply! >> >> On Thu, May 17, 2018 at 09:10:06AM +0000, Artur Petrosyan wrote: >>> Hi Mani, >>> >>> We need some detailed information to perform debugging. >>> >>> 1. Could you please share the documentation of "96Boards HiKey" board, at least dwc core configuration parameters. Or dump of GHWCFG1-4. >> >> You can find the HiKey documentation here: >> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_96boards_documentation_tree_master_consumer_hikey_hardware-2Ddocs&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=9hPBFKCJ_nBjJhGVrrlYOeOQjP_HlVzYqrC_D7niMJI&m=6LhexoM7WPYJCGKz9Ht2lFT0FTJGYReuH-DLADH3jTk&s=jpHs7p6qQrZZ70jXyaj4fon8SE7y6N4rds4ZmuXr-8s&e= >> >> GHWCFG register dump: >> >> GHWCFG1 = 0x00000000 >> GHWCFG2 = 0x23affc70 >> GHWCFG3 = 0x0780d4e8 >> GHWCFG4 = 0xfff00060 >> >>> 2. Could you please share with us full debug log of dwc2 loading and plug the USB device. >> >> Here is the full kernel log from the boot till USB device gets plugged in: >> https://urldefense.proofpoint.com/v2/url?u=https-3A__pastebin.ubuntu.com_p_3bZwWtk8wD_&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=9hPBFKCJ_nBjJhGVrrlYOeOQjP_HlVzYqrC_D7niMJI&m=6LhexoM7WPYJCGKz9Ht2lFT0FTJGYReuH-DLADH3jTk&s=e2qpTQMTCiMabfKTLZiHML--9dJd_iEbSpnbO8oVruE&e= >> >>> 3. From short debug log seen that Host exited from hibernation after USB device plugged to the port. Do you mean that enumeration process didn't start? If not, could you please dump registers after "dwc2 f72c0000.usb: Host hibernation restore complete" >> >> Yeah, I guess the enumeration process didn't happen at all. Here is the >> register dump after plugging the device: >> >> https://urldefense.proofpoint.com/v2/url?u=https-3A__pastebin.ubuntu.com_p_3vxdkFGgp6_&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=9hPBFKCJ_nBjJhGVrrlYOeOQjP_HlVzYqrC_D7niMJI&m=6LhexoM7WPYJCGKz9Ht2lFT0FTJGYReuH-DLADH3jTk&s=scjqjTPnWj7MbUktAI5S6zao5g7KXG4gDfg-wNC1zfc&e= >> >>> 4. In which mode had the dwc2 been built. In host only mode or DRD mode? >> >> DWC2 in HiKey is built in Dual Role Device (DRD) mode. >> >>> 5. And you mention that USB controller's DP/DM out is connected to a switch which switches between a USB type C port and a HUB (USB2513B). Is the device connected to USB type C port or to HUB (USB2513B) ? Switching connection done before dwc2 load or after? >>> >> >> The USB device is connected to one of the ports from HUB and there is one >> gpio which is used for switching the USB ports between Type-C and HUB. By >> default, this gpio is unused and it pulled low, which means HUB will get >> selected before dwc2 gets loaded. >> >> Hope this information will help debugging the issue. >> >> Thanks, >> Mani >> >>> Looking forward to your reply. >>> >>> Regards, >>> Artur >>> >>> >>> -----Original Message----- >>> From: Manivannan Sadhasivam [mailto:manivannan.sadhasivam@xxxxxxxxxx] >>> Sent: Wednesday, May 16, 2018 17:23 >>> To: linux-usb@xxxxxxxxxxxxxxx >>> Cc: John.Youn@xxxxxxxxxxxx; mvardan@xxxxxxxxxxxx; Arthur.Petrosyan@xxxxxxxxxxxx; Grigor.Tovmasyan@xxxxxxxxxxxx; felipe.balbi@xxxxxxxxxxxxxxx >>> Subject: usb: dwc2: Regression on 96Boards Hikey due to enabling power down >>> >>> Hello, >>> >>> Commit 03ea6d6e9e1ff1b0222eb723eee5990d3511cc4d introduced the powerdown feature in USB DWC2 driver which stops USB from working on 96Boards HiKey board. >>> >>> During bootup, USB host controller goes into hibernation state and when any USB device is plugged onto the port, the host finishes executing the GPWRDN interrupt handler but still it didn't wake up. >>> >>> Below is the dmesg log after plugging a device onto USB port: >>> >>> [ 30.763414] dwc2 f72c0000.usb: dwc2_handle_gpwrdn_intr: dwc2_handle_gpwrdwn_intr called gpwrdn= 081411bb >>> [ 30.763458] dwc2 f72c0000.usb: dwc2_handle_gpwrdn_intr: GPWRDN_LNSTSCHG >>> [ 30.763492] dwc2 f72c0000.usb: dwc2_host_exit_hibernation: called with rem_wakeup = 1 reset = 0 >>> [ 30.763623] dwc2 f72c0000.usb: dwc2_restore_essential_regs: restoring essential regs >>> [ 30.763671] dwc2 f72c0000.usb: restore done generated here >>> [ 30.976707] dwc2 f72c0000.usb: dwc2_restore_global_registers >>> [ 30.976723] dwc2 f72c0000.usb: dwc2_restore_host_registers >>> [ 30.976741] dwc2 f72c0000.usb: Host hibernation restore complete >>> >>> I tried to manually reset the HUB and PHY after plugging in the device but that didn't help. >>> >>> This issue has been detected in kernel 4.17-rc1. >>> >>> Can anyone shed some light here? Any help would be greatly appreciated! >>> >>> Note: On this board, the USB controller's DP/DM out is connected to a switch which switches between a USB type C port and a HUB (USB2513B). >>> >>> Thanks, >>> Mani > -- 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