-
Notifications
You must be signed in to change notification settings - Fork 6
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
Compiler read/write reorderings make DMA flaky #6
Comments
The new patch impiaaa provided fixes the problem with |
Turns out the patch might not fix the underlying issue since it makes To avoid having to build libgcc, the sdk could also provide |
After playing around with An alternative which may work without this hack is to attach a |
DMA transfers can be flaky due to compiler misoptimizations. The problem is that llvm emits a MIPS-II instruction for the compiler_fence. So rustc gives the following error when I try adding the fence. Afaiu other llvm backends implement compiler fences without emitting instructions so it should be possible to fix this codegen issue.
For now the least flaky solution seems to be calling
black_box
on the pointer passed to the DMA channel (even though it shouldn't be relied on for correctness). I still get builds where DMA doesn't work (usually when toggling LTO or the min-panic feature), but it seems less frequent than with the llvm_asm("":::"memory", "volatile") hack.The text was updated successfully, but these errors were encountered: