summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Vincent <[email protected]>2025-04-10 10:29:45 +0200
committerMaxime Vincent <[email protected]>2025-04-15 09:01:39 +0200
commit384e191fdc9346eb8718f1f3e50f4697f161cc88 (patch)
tree876e81e02dda82f7f47a30de43895e650fb75087
parentbfe08176e516fede93dcd0bb3d43b4044fea25e4 (diff)
dwc2/host: immediately retry IN token for bInterval=1
Signed-off-by: Maxime Vincent <[email protected]>
-rw-r--r--src/portable/synopsys/dwc2/hcd_dwc2.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/portable/synopsys/dwc2/hcd_dwc2.c b/src/portable/synopsys/dwc2/hcd_dwc2.c
index 33c0edba1..6e2737afd 100644
--- a/src/portable/synopsys/dwc2/hcd_dwc2.c
+++ b/src/portable/synopsys/dwc2/hcd_dwc2.c
@@ -736,6 +736,14 @@ static void channel_xfer_in_retry(dwc2_regs_t* dwc2, uint8_t ch_id, uint32_t hci
}
}
+ // immediately retry if bInterval is 1 - otherwise we'd waste a microframe before retrying
+ if ((hcint & HCINT_HALTED) && (edpt->uframe_interval == 1)) {
+ edpt->hcchar_bm.odd_frame = 1 - (dwc2->hfnum & 1); // transfer on next frame
+ channel->hcchar = (edpt->hcchar & ~HCCHAR_CHENA);
+ channel_send_in_token(dwc2, channel);
+ return;
+ }
+
// for periodic, de-allocate channel, enable SOF set frame counter for later transfer
const dwc2_channel_tsize_t hctsiz = {.value = channel->hctsiz};
edpt->next_pid = hctsiz.pid; // save PID