UPSTREAM: usb: dwc3: gadget: Synchronize IRQ between soft connect/disconnect

Ensure that there are no pending events being handled in between soft
connect/disconnect transitions.  As we are keeping interrupts enabled,
and EP0 events are still being serviced, this avoids any stale events from
being serviced.

Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220817182359.13550-4-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit 9711c67de7482c81e1daca3548fbc5c9603600e3)

Bug: 263189538
Change-Id: I8ec1e0ec2fe2d48f5db26e833fb9456936380e28
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
This commit is contained in:
Wesley Cheng
2022-08-17 11:23:53 -07:00
committed by Todd Kjos
parent 35cb147c38
commit 0bbc89c346

View File

@@ -2562,6 +2562,8 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
return 0; return 0;
} }
synchronize_irq(dwc->irq_gadget);
if (!is_on) { if (!is_on) {
ret = dwc3_gadget_soft_disconnect(dwc); ret = dwc3_gadget_soft_disconnect(dwc);
} else { } else {