Skip to content

Commit ee2cfcb

Browse files
hoshinolinajannau
authored andcommitted
drm/asahi: mmu: Add some barriers
Just being paranoid. Signed-off-by: Asahi Lina <lina@asahilina.net>
1 parent f1854b9 commit ee2cfcb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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,
@@ -352,6 +353,7 @@ impl gpuvm::DriverGpuVm for VmInner {
352353
self.unmap_pages(unmap_start, UAT_PGSZ, (unmap_range >> UAT_PGBIT) as usize)?;
353354

354355
if let Some(asid) = self.slot() {
356+
fence(Ordering::SeqCst);
355357
mem::tlbi_range(asid as u8, unmap_start as usize, unmap_range as usize);
356358
mod_dev_dbg!(
357359
self.dev,
@@ -662,6 +664,7 @@ impl KernelMapping {
662664
self.size()
663665
);
664666
}
667+
fence(Ordering::SeqCst);
665668

666669
// If we don't have (and have never had) a VM slot, just return
667670
let slot = match owner.slot() {
@@ -812,6 +815,7 @@ impl Drop for KernelMapping {
812815
}
813816

814817
if let Some(asid) = owner.slot() {
818+
fence(Ordering::SeqCst);
815819
mem::tlbi_range(asid as u8, self.iova() as usize, self.size());
816820
mod_dev_dbg!(
817821
owner.dev,

0 commit comments

Comments
 (0)