Skip to content

Commit ad3483c

Browse files
committed
usb: dwc2: gadget: avoid stop disabled interrupt ep
When we test RK3308 USB gadget with UAC + HID composite function, connect to PC USB Host, and do hotplug test. The HID may fail to do ep in transfer. It's because that when USB disconnect, the dwc2 call dwc2_hsotg_ep_disable() to disable all enabled endpoints. However, for HID in ep, the dwc2 call dwc2_hsotg_ep_stop_xfr() to stop transfer even if the HID in ep has been disabled. This cause HID in ep transfer fail when USB connect next time. Fixes: 0ba9849 ("usb: dwc2: gadget: stop isoc ep in transfer when disable ep") Signed-off-by: William Wu <william.wu@rock-chips.com> Change-Id: I316410ec8ff30cf5e298cfcad327456dbae4e970
1 parent 1bc5506 commit ad3483c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/usb/dwc2/gadget.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3330,7 +3330,8 @@ static int dwc2_hsotg_ep_disable(struct usb_ep *ep)
33303330
ctrl = dwc2_readl(hsotg->regs + epctrl_reg);
33313331

33323332
/* stop isoc ep in transfer even if the ep is disabled */
3333-
if ((ctrl & DXEPCTL_EPENA) || (dir_in && (ctrl & DXEPCTL_EPTYPE_ISO)))
3333+
if ((ctrl & DXEPCTL_EPENA) ||
3334+
(dir_in && ((ctrl & DXEPCTL_EPTYPE_MASK) == DXEPCTL_EPTYPE_ISO)))
33343335
dwc2_hsotg_ep_stop_xfr(hsotg, hs_ep);
33353336

33363337
ctrl &= ~DXEPCTL_EPENA;

0 commit comments

Comments
 (0)