Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(spi): Unlock DMA transfers for SpiBus::transfer_in_place #780

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

jbeaurivage
Copy link
Contributor

@jbeaurivage jbeaurivage commented Nov 9, 2024

Fixes unsoundness issues caused by mishandled memory barriers in the dmac module.

These were causing observable undefined behaviour in the SpiBus::transfer_in_place implementation when trying to use DMA. The implementation was therefore defaulted to using word-by-word transfers in #772.

Now that the bug is fixed, we also unlock DMA in-place transfers for SPI. I've tested the changes and can confirm that there is no longer exhibited unsoundness.

This PR also brings minor refactors to the dmac module, and fixes warnings when compiling with the dma Cargo feature turned off.

Checklist

  • All new or modified code is well documented, especially public items
  • No new warnings or clippy suggestions have been introduced - CI will deny clippy warnings by default! You may #[allow] certain lints where reasonable, but ideally justify those with a short comment.

Also fix potential UB caused by mishandled memory
barriers in `dmac
@jbeaurivage jbeaurivage mentioned this pull request Nov 9, 2024
9 tasks
@sajattack sajattack merged commit 7a2d76d into atsamd-rs:master Nov 12, 2024
108 checks passed
@github-actions github-actions bot mentioned this pull request Nov 11, 2024
@jbeaurivage jbeaurivage deleted the spi-xfer-in-place branch November 12, 2024 14:29
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.

2 participants