diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c --- a/drivers/usb/dwc3/drd.c +++ b/drivers/usb/dwc3/drd.c @@ -55,7 +55,17 @@ spin_lock(&dwc->lock); if (dwc->otg_restart_host) { - dwc3_otg_host_init(dwc); + /* + * flare-edge#160: dwc3_otg_host_init() is documented as "should be + * called before Host controller driver is started" but this path + * only ever runs while current_otg_role is already HOST. Skip it + * on a live host and record that we did. + */ + if (dwc->current_otg_role == DWC3_OTG_ROLE_HOST) + dev_warn_ratelimited(dwc->dev, + "OTGDIAG skipped host re-init on live host\n"); + else + dwc3_otg_host_init(dwc); dwc->otg_restart_host = false; } @@ -83,6 +93,10 @@ if (dwc->current_otg_role == DWC3_OTG_ROLE_HOST && !(reg & DWC3_OEVT_DEVICEMODE)) dwc->otg_restart_host = true; + /* flare-edge#160 diagnostic: is the OTG event path active at all? */ + dev_warn_ratelimited(dwc->dev, + "OTGDIAG irq OEVT=0x%08x role=%u restart=%d\n", + reg, dwc->current_otg_role, dwc->otg_restart_host); dwc3_writel(dwc, DWC3_OEVT, reg); ret = IRQ_WAKE_THREAD; }