diff options
author | Wesley Cheng <quic_wcheng@quicinc.com> | 2022-08-17 20:23:53 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-08-31 09:07:53 +0200 |
commit | 9711c67de7482c81e1daca3548fbc5c9603600e3 (patch) | |
tree | 5b804622d00cb5f3d01fad49340d466ad770cc86 /drivers/usb/dwc3 | |
parent | usb: dwc3: gadget: Force sending delayed status during soft disconnect (diff) | |
download | linux-9711c67de7482c81e1daca3548fbc5c9603600e3.tar.xz linux-9711c67de7482c81e1daca3548fbc5c9603600e3.zip |
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>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 004b8c4746a7..311348aea58e 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2569,6 +2569,8 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) return 0; } + synchronize_irq(dwc->irq_gadget); + if (!is_on) { ret = dwc3_gadget_soft_disconnect(dwc); } else { |