summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiFiPHile <[email protected]>2026-08-25 09:26:37 +0200
committerHiFiPHile <[email protected]>2026-08-25 09:26:37 +0200
commit191b443d3a4f68176a637ae5b3159ef10f478485 (patch)
treeca8dc9c6f89146e6fd8ff946e41a81d2fc2b3c8c
parentf9ba5d48e0d1926488c78be6d385137f99b277b7 (diff)
fix(dwc2): complete periodic IN channels immediately
The core has already halted a periodic IN channel when every packet completes. Report the transfer at that point instead of requesting another halt interrupt, allowing the next service interval to be queued without delay. Signed-off-by: HiFiPHile <[email protected]>
-rw-r--r--src/portable/synopsys/dwc2/hcd_dwc2.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/portable/synopsys/dwc2/hcd_dwc2.c b/src/portable/synopsys/dwc2/hcd_dwc2.c
index 12918a9f7..7fbefff86 100644
--- a/src/portable/synopsys/dwc2/hcd_dwc2.c
+++ b/src/portable/synopsys/dwc2/hcd_dwc2.c
@@ -950,7 +950,13 @@ static bool handle_channel_in_slave(dwc2_regs_t* dwc2, uint8_t ch_id, uint32_t h
xfer->result = XFER_RESULT_SUCCESS;
}
- channel_disable(dwc2, channel);
+ if (channel_is_periodic(channel->hcchar) && remain_packets == 0) {
+ // The core has already halted a completed periodic IN channel. Complete
+ // it now so the next interval can be submitted without another halt IRQ.
+ is_done = true;
+ } else {
+ channel_disable(dwc2, channel);
+ }
} else if (hcint & (HCINT_XACT_ERR | HCINT_BABBLE_ERR | HCINT_STALL)) {
if (hcint & HCINT_STALL) {
xfer->result = XFER_RESULT_STALLED;