Skip to content

Commit 20d4b19

Browse files
committed
dma: Fix compiler fence on Transfer stop
The ordering previously used here (Acquire) was not strong enough, since it only prevents memory reads after the fence to be moved before the last read before the fence. We want to prevent moving before the last *write* before the fence (the one that disables DMA). The SeqCst ordering does that for us.
1 parent 11aa9cc commit 20d4b19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dma.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl<B, C: Channel, T> TransferInner<B, C, T> {
146146
/// Stop this transfer
147147
fn stop(&mut self) {
148148
self.channel.disable();
149-
atomic::compiler_fence(Ordering::Acquire);
149+
atomic::compiler_fence(Ordering::SeqCst);
150150
}
151151
}
152152

0 commit comments

Comments
 (0)