If core enters host hibernation when switching from device mode to host mode disconnection of host cable asserts a WARNING in dwc2_hsotg_init_fifo() that fifo_map is not cleared. To avoid the WARNING, fifo_map should be cleared in dwc2_core_reset() function. - Cleared fifo_map when resetting the core. Signed-off-by: Artur Petrosyan <arturp@xxxxxxxxxxxx> --- drivers/usb/dwc2/core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index fb471d18a3de..fbbd6a2f10ad 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c @@ -532,6 +532,12 @@ int dwc2_core_reset(struct dwc2_hsotg *hsotg, bool skip_wait) greset |= GRSTCTL_CSFTRST; dwc2_writel(hsotg, greset, GRSTCTL); + /* Clear fifo_map */ + #if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \ + IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE) + hsotg->fifo_map = 0; + #endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */ + if (dwc2_hsotg_wait_bit_clear(hsotg, GRSTCTL, GRSTCTL_CSFTRST, 50)) { dev_warn(hsotg->dev, "%s: HANG! Soft Reset timeout GRSTCTL GRSTCTL_CSFTRST\n", __func__); -- 2.11.0