Skip to content

refactor(gpio): share async lifecycle and isolate per-pin waits - #21

Draft
sanchuanhehe wants to merge 3 commits into
fix/dma-controller-lifetimefrom
refactor/gpio-async-lifecycle
Draft

sanchuanhehe wants to merge 3 commits into
fix/dma-controller-lifetimefrom
refactor/gpio-async-lifecycle

Conversation

@sanchuanhehe

@sanchuanhehe sanchuanhehe commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

GPIO async waits now share a PAC-independent lifecycle for first-poll setup, Waker registration, latched completion and cancellation. WS53 retains whole-bank handoff; WS63 retains per-pin ownership, with IRQ bindings and pin count in SoC configuration. No executor, time queue or Embassy dependency is added.

WS63 previously used one completion flag per bank, allowing empty/unrelated IRQs to complete the wrong wait, and did not stop cancelled waits. Per-pin slots fix this. Temporary masking now uses an experimental interrupt::mask that preserves pending events: cancelling one pin or re-polling must not acknowledge another latched event. Existing disable keeps its mask-and-clear behavior. The changes are split into behavior-preserving extraction, per-pin adaptation, and pending-preservation commits.

Validation: independent host tests WS63/WS53/BS21 358/438/220; all three target Clippy checks, WS53/WS63 doctests, no-Embassy graphs and register policy pass. Parent QEMU covers simultaneous same-bank waits, empty IRQ, three cancellations including an already-pending peer, immediate levels and edges. WS53 retains eight wakes/two cancellations and adds directional-edge re-poll before ISR. The original baseline fails the empty-IRQ assertion; the intermediate revision fails the pending-peer case. Both failures are preserved. The final pinned remote consumer links and passes the WS63 model scenario without parent patches.

No hardware operations or new physical qualification. Stable interfaces and BS21 async capabilities remain unchanged. Physical acknowledgement timing, cross-core/unrelated-ISR register arbitration, legacy any-edge setup limitations, block_on wake/idle and DMA safety remain open. Stacked on fix/dma-controller-lifetime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant