Skip to content

Commit 8b212d8

Browse files
tmon-nordickartben
authored andcommitted
drivers: udc_dwc2: Fix isochronous endpoint disable
The NAKSts bit may be set on isochronous OUT endpoints when incomplete ISO OUT interrupt is raised. The code would then assume that endpoint is already disabled and would not perform the endpoint disable procedure. This in turn was essentially halting any transmission on the isochronous endpoint, abruptly terminating the data stream. Fix the issue by always following full endpoint disable procedure on isochronous endpoints. Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
1 parent d7d636d commit 8b212d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/usb/udc/udc_dwc2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1387,11 +1387,12 @@ static void udc_dwc2_ep_disable(const struct device *dev,
13871387
uint8_t ep_idx = USB_EP_GET_IDX(cfg->addr);
13881388
mem_addr_t dxepctl_reg;
13891389
uint32_t dxepctl;
1390+
const bool is_iso = dwc2_ep_is_iso(cfg);
13901391

13911392
dxepctl_reg = dwc2_get_dxepctl_reg(dev, cfg->addr);
13921393
dxepctl = sys_read32(dxepctl_reg);
13931394

1394-
if (dxepctl & USB_DWC2_DEPCTL_NAKSTS) {
1395+
if (!is_iso && (dxepctl & USB_DWC2_DEPCTL_NAKSTS)) {
13951396
/* Endpoint already sends forced NAKs. STALL if necessary. */
13961397
if (stall) {
13971398
dxepctl |= USB_DWC2_DEPCTL_STALL;

0 commit comments

Comments
 (0)