<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinyusb.git/src, branch agent/fix-dwc2-host-fifo-allocation</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/tinyusb.git/atom/src?h=agent%2Ffix-dwc2-host-fifo-allocation</id>
<link rel='self' href='http://cgit.235523.xyz/tinyusb.git/atom/src?h=agent%2Ffix-dwc2-host-fifo-allocation'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/'/>
<updated>2026-09-01T02:37:46Z</updated>
<entry>
<title>fix(dwc2): queue initial slave OUT packet immediately</title>
<updated>2026-09-01T02:37:46Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-01T02:04:01Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=a0e4f90765738a78d4a49cdc3b0725e04cd498fb'/>
<id>urn:sha1:a0e4f90765738a78d4a49cdc3b0725e04cd498fb</id>
<content type='text'>
In slave mode, channel_xfer_start() enabled an OUT channel but left every FIFO write to a later PTXFEMP interrupt. DWC2 creates the request-queue entry only when the packet's final FIFO word is written, so unrelated interrupt work could consume the selected service frame before the transfer was actually queued.

Factor FIFO writes into a capacity-checked helper and write the initial packet while the channel-enable operation is still protected from DWC2 interrupts. Keep FIFO-empty interrupts only for data that does not fit immediately. The protected section never waits for FIFO or request-queue space.

When initial periodic OUT submission is too close to the frame boundary, release the unused channel and defer the still-pending endpoint to the next SOF. Internal retries bypass this initial boundary guard.

A hardware trace showed HCCHAR enabled for frame 0x0378 while the packet's final FIFO word was delayed until frame 0x03ae. The complete five-commit fix set passed 600 seconds in every O0/O2 and slave/DMA mode.

Signed-off-by: HiFiPHile &lt;admin@hifiphile.com&gt;
</content>
</entry>
<entry>
<title>fix(dwc2): enable periodic channels in the selected frame</title>
<updated>2026-09-01T02:37:46Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-01T02:02:54Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=b8402d11a89289b58a761ed0914e4421a3268bd2'/>
<id>urn:sha1:b8402d11a89289b58a761ed0914e4421a3268bd2</id>
<content type='text'>
Periodic IN and DMA-backed transfers selected ODDFRM before waiting for request-queue space. A DWC2 interrupt could also run between reading HFNUM and writing HCCHAR.CHENA, allowing the selected frame to pass while the transfer still appeared active.

Wait for request-queue capacity with controller interrupts enabled, then mask only GAHBCFG.GINT while sampling HFNUM and enabling a new periodic channel. The bounded critical section contains no queue wait, callback, disable, or allocation loop. Retries that already selected their frame bypass the new selection step.

Also clear a retained HCCHAR.CHDIS before every channel enable. A halted channel can otherwise be re-enabled as CHENA|CHDIS and wait for a terminal interrupt that never arrives.

Hardware traces captured periodic IN selections at frames 0x3303 and 0x3266 but activation only after 0x330c and 0x3273, respectively.
</content>
</entry>
<entry>
<title>fix(dwc2): fail missed isochronous frames</title>
<updated>2026-09-01T02:37:46Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-01T01:59:39Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=0cf6104274c10675cbfa4f0be1c2944fab8bdff3'/>
<id>urn:sha1:0cf6104274c10675cbfa4f0be1c2944fab8bdff3</id>
<content type='text'>
A frame-overrun interrupt means the selected periodic service interval has already been missed. Retrying an isochronous transfer after that point cannot deliver the original packet and can leave the class waiting indefinitely for a terminal result.

Enable frame-overrun interrupts for slave periodic channels. Complete isochronous IN and OUT overruns as XFER_RESULT_FAILED in both slave and DMA modes, accounting for bytes already written on OUT. Preserve the existing retry behavior for non-isochronous DMA transfers.

This reports the missed packet honestly through the normal HCD completion path: no fabricated success and no class-level abort workaround.
</content>
</entry>
<entry>
<title>fix(dwc2): let DMA periodic channels halt naturally</title>
<updated>2026-09-01T02:37:46Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-01T01:47:15Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=a1b491512fa4fd0f740c04dd8c990fb532e24f9c'/>
<id>urn:sha1:a1b491512fa4fd0f740c04dd8c990fb532e24f9c</id>
<content type='text'>
DWC2 buffer/external DMA mode automatically halts a periodic channel at its next service boundary. Programming HCCHAR.CHDIS|CHENA for a non-split periodic channel is explicitly disallowed by the controller programming guide, yet channel_disable() skipped that write only for split periodic transfers.

Return without programming channel disable for every periodic DMA channel. Non-periodic DMA and slave-mode channels retain the existing explicit-disable path.

The previous path reproduced after 420 seconds in O2/DMA with a closing capture transfer left INVALID while HCCHAR retained CHENA|CHDIS and HCINT was clear.
</content>
</entry>
<entry>
<title>fix(dwc2): preserve simultaneous slave channel halt</title>
<updated>2026-09-01T02:37:46Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-01T01:46:15Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=07c642db3149cbfaac579fa6303727361a78606f'/>
<id>urn:sha1:07c642db3149cbfaac579fa6303727361a78606f</id>
<content type='text'>
Slave-mode channel handlers process one interrupt cause per pass, but the dispatcher acknowledged every HCINT bit before invoking them. When ChHltd arrived together with another cause, the handler consumed the other cause and the halt was lost. A subsequent disable could then leave CHENA|CHDIS asserted with HCINT and HAINT clear, so the submitted periodic transfer never completed.

When a slave channel reports ChHltd with another cause, acknowledge only the non-halt causes and leave ChHltd pending for the next channel-IRQ pass. DMA handlers retain their existing combined-cause behavior.

The uninstrumented negative capture reproduced the lost terminal state with HCCHAR=0xe044881c, HCTSIZ=0x0008001c, HCINT=0, and XFER_RESULT_INVALID.
</content>
</entry>
<entry>
<title>fix(dwc2): serialize deferred transfer abort</title>
<updated>2026-08-31T03:26:36Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-08-27T13:35:56Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=6c074b95400ee5b8b40225e7a6485bc4f4f1ca00'/>
<id>urn:sha1:6c074b95400ee5b8b40225e7a6485bc4f4f1ca00</id>
<content type='text'>
Protect periodic deferral cancellation from the SOF interrupt. Re-enable the host interrupt before disabling an active channel because slave-mode channel disable may wait for request-queue space.
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'origin/master' into agent/fix-dwc2-host-fifo-allocation</title>
<updated>2026-08-31T03:26:19Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-08-31T03:26:19Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=76d726ed8cd8efc4d6b648b72d24e867660c067e'/>
<id>urn:sha1:76d726ed8cd8efc4d6b648b72d24e867660c067e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix(dwc2): drain host RX status before channel IRQ</title>
<updated>2026-08-31T03:26:01Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-08-27T12:49:47Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=7e08c1014a6ca9b50585946fc960cc5691e22fe3'/>
<id>urn:sha1:7e08c1014a6ca9b50585946fc960cc5691e22fe3</id>
<content type='text'>
Popping an IN transfer-completion entry from GRXSTSP asserts HCINT.XferCompl. Drain the receive FIFO first, then read the live masked global status so the newly asserted channel completion is handled without waiting for another interrupt.
</content>
</entry>
<entry>
<title>Merge branch 'master' into agent/fix-dwc2-host-fifo-allocation</title>
<updated>2026-08-25T07:55:24Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-08-25T07:55:24Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=44691c267c158d634e3ddd605a307ff9e0cc0249'/>
<id>urn:sha1:44691c267c158d634e3ddd605a307ff9e0cc0249</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix(dwc2): preserve periodic transfer phase</title>
<updated>2026-08-25T07:26:38Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-08-25T07:26:38Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=8a2f1651132b21c3990a2ecb8c19f702b0629b5d'/>
<id>urn:sha1:8a2f1651132b21c3990a2ecb8c19f702b0629b5d</id>
<content type='text'>
Anchor resubmitted periodic transfers to the endpoint service interval and defer early submissions through SOF. This prevents callback latency from shifting the cadence or causing intervals to be skipped, while keeping pending transfers abortable.

Signed-off-by: HiFiPHile &lt;admin@hifiphile.com&gt;
</content>
</entry>
</feed>
