Skip to content

Commit ecf9fc5

Browse files
committed
drm/asahi: mmu: Add some barriers
Just being paranoid. Signed-off-by: Asahi Lina <[email protected]>
1 parent 801116e commit ecf9fc5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/asahi/mmu.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ impl gpuvm::DriverGpuVm for VmInner {
299299
self.unmap_pages(va.addr(), UAT_PGSZ, (va.range() >> UAT_PGBIT) as usize)?;
300300

301301
if let Some(asid) = self.slot() {
302+
fence(Ordering::SeqCst);
302303
mem::tlbi_range(asid as u8, va.addr() as usize, va.range() as usize);
303304
mod_dev_dbg!(
304305
self.dev,
@@ -354,6 +355,7 @@ impl gpuvm::DriverGpuVm for VmInner {
354355
self.unmap_pages(unmap_start, UAT_PGSZ, (unmap_range >> UAT_PGBIT) as usize)?;
355356

356357
if let Some(asid) = self.slot() {
358+
fence(Ordering::SeqCst);
357359
mem::tlbi_range(asid as u8, unmap_start as usize, unmap_range as usize);
358360
mod_dev_dbg!(
359361
self.dev,
@@ -656,6 +658,7 @@ impl KernelMapping {
656658
self.size()
657659
);
658660
}
661+
fence(Ordering::SeqCst);
659662

660663
// If we don't have (and have never had) a VM slot, just return
661664
let slot = match owner.slot() {
@@ -806,6 +809,7 @@ impl Drop for KernelMapping {
806809
}
807810

808811
if let Some(asid) = owner.slot() {
812+
fence(Ordering::SeqCst);
809813
mem::tlbi_range(asid as u8, self.iova() as usize, self.size());
810814
mod_dev_dbg!(
811815
owner.dev,

0 commit comments

Comments
 (0)