The issue is related to the usb: dwc3: core: Do core softreset when switch mode in the Linux kernel. According to the programming guide, to switch mode for DRD controller, the driver needs to follow specific steps. However, steps 1 and 3 are missing when switching from host to device, which can cause a lockup issue, as reported by John Stult with the HiKey960 platform and observed with Ferry's testing platform. The main fixes include adding the missing wait for clocks synchronization before clearing GCTL.CoreSoftReset and only applying DCTL.CSftRst when switching from host to device.