[jsun] I don't know what I'm doing, but it works, it seems.

Basically during unpluggying, I only saw NTSTS_ERLYSUSP interrupt.
So I mirrored some early processing of RESET interrupt and perform
diconnect() call.
diff -Nru b/drivers/usb/dwc2/gadget.c.orig b/drivers/usb/dwc2/gadget.c
--- b/drivers/usb/dwc2/gadget.c.orig	2017-10-29 02:58:27.000000000 -0700
+++ b/drivers/usb/dwc2/gadget.c	2017-12-01 22:35:34.593563572 -0800
@@ -2872,8 +2872,17 @@
 	}
 
 	if (gintsts & GINTSTS_ERLYSUSP) {
+		u32 usb_status = dwc2_readl(hsotg->regs + GOTGCTL);
+		u32 connected = hsotg->connected;
+
 		dev_dbg(hsotg->dev, "GINTSTS_ErlySusp\n");
 		dwc2_writel(GINTSTS_ERLYSUSP, hsotg->regs + GINTSTS);
+
+		/* Report disconnection if it is not already done. */
+		dwc2_hsotg_disconnect(hsotg);
+
+		if (usb_status & GOTGCTL_BSESVLD && connected)
+			dwc2_hsotg_core_init_disconnected(hsotg, true);
 	}
 
 	/*
