Skip to contentSkip to conversation

usb: dwc2: gadget: Consider VBUS discharge time in disconnect flow

DISCUSSION Felipe Balbi 1 participant 1 message Feb 7, 2019 USB

lore
Share & tools
lore
#0 lore raw

Hi,

Quoted 10 lines · Minas Harutyunyan
drivers/usb/dwc2/gadget.c +2 -0
index 68ad75a7460d..eab1da4c0beb 100644
@@ -3689,6 +3689,14 @@ static irqreturn_t dwc2_hsotg_irq(int irq, void *pw)
 	if (gintsts & GINTSTS_ERLYSUSP) {
 		dev_dbg(hsotg->dev, "GINTSTS_ErlySusp\n");
 		dwc2_writel(hsotg, GINTSTS_ERLYSUSP, GINTSTS);
+
+		mdelay(hsotg->params.vbus_discharge_time);

<snip>

drivers/usb/dwc2/gadget.c

Quoted 1 line
drivers/usb/dwc2/gadget.c +1 -0
+	p->vbus_discharge_time = 1000;

A whole second?? Wow. Perhaps you need to rethink this patch a little.