Skip to content

fix(dma): retain controller ownership across forgotten guards - #20

Draft
sanchuanhehe wants to merge 1 commit into
refactor/timer-async-lifecyclefrom
fix/dma-controller-lifetime
Draft

sanchuanhehe wants to merge 1 commit into
refactor/timer-async-lifecyclefrom
fix/dma-controller-lifetime

Conversation

@sanchuanhehe

Copy link
Copy Markdown
Collaborator

A short DMA controller reborrow could launch a transfer, forget its guard, and regain the original controller token while retained hardware state remained live. Require a 'static controller lifetime at the three experimental owned-guard launch methods. Moving the original Peripherals::DMA token remains supported; add negative and positive documentation tests.

Validation: standalone development graph host tests WS63/BS21/WS53 351/220/432, all three RISC-V Clippy checks, WS63/BS21 doctests, and owned-token host/target consumers pass. The old revision accepts the reborrow counterexample; this change rejects it with E0521/E0499. WS63 DMA example and BS21 example build/check pass. BS20 locked check is separately blocked by its stale lockfile.

This changes a compile-time ownership boundary only. No hardware or QEMU run, register behavior change, or stable API graduation. Normal completion bus drain, cache ownership and higher-level DMA safety remain unproven. Stacked on the timer lifecycle branch to keep this review limited to one unit.

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