Skip to content

Commit 9d50bff

Browse files
mchehabrodrigovivi
authored andcommitted
drm/i915: pass a pointer for tlb seqno at vma_invalidate_tlb()
WRITE_ONCE() should happen at the original var, not on a local copy of it. Cc: [email protected] Fixes: 59eda6c ("drm/i915/gt: Batch TLB invalidations") Signed-off-by: Mauro Carvalho Chehab <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]> [added cc-stable while merging it] Link: https://patchwork.freedesktop.org/patch/msgid/f9550e6bacea10131ff40dd8981b69eb9251cdcd.1659598090.git.mchehab@kernel.org (cherry picked from commit 3d037d9) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 2826d44 commit 9d50bff

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

drivers/gpu/drm/i915/gt/intel_ppgtt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ void ppgtt_unbind_vma(struct i915_address_space *vm,
211211

212212
vm->clear_range(vm, vma_res->start, vma_res->vma_size);
213213
if (vma_res->tlb)
214-
vma_invalidate_tlb(vm, *vma_res->tlb);
214+
vma_invalidate_tlb(vm, vma_res->tlb);
215215
}
216216

217217
static unsigned long pd_count(u64 size, int shift)

drivers/gpu/drm/i915/i915_vma.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ I915_SELFTEST_EXPORT int i915_vma_get_pages(struct i915_vma *vma)
13081308
return err;
13091309
}
13101310

1311-
void vma_invalidate_tlb(struct i915_address_space *vm, u32 tlb)
1311+
void vma_invalidate_tlb(struct i915_address_space *vm, u32 *tlb)
13121312
{
13131313
/*
13141314
* Before we release the pages that were bound by this vma, we
@@ -1318,7 +1318,7 @@ void vma_invalidate_tlb(struct i915_address_space *vm, u32 tlb)
13181318
* the most recent TLB invalidation seqno, and if we have not yet
13191319
* flushed the TLBs upon release, perform a full invalidation.
13201320
*/
1321-
WRITE_ONCE(tlb, intel_gt_next_invalidate_tlb_full(vm->gt));
1321+
WRITE_ONCE(*tlb, intel_gt_next_invalidate_tlb_full(vm->gt));
13221322
}
13231323

13241324
static void __vma_put_pages(struct i915_vma *vma, unsigned int count)
@@ -1971,7 +1971,7 @@ struct dma_fence *__i915_vma_evict(struct i915_vma *vma, bool async)
19711971
dma_fence_put(unbind_fence);
19721972
unbind_fence = NULL;
19731973
}
1974-
vma_invalidate_tlb(vma->vm, vma->obj->mm.tlb);
1974+
vma_invalidate_tlb(vma->vm, &vma->obj->mm.tlb);
19751975
}
19761976

19771977
/*

drivers/gpu/drm/i915/i915_vma.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ bool i915_vma_misplaced(const struct i915_vma *vma,
213213
u64 size, u64 alignment, u64 flags);
214214
void __i915_vma_set_map_and_fenceable(struct i915_vma *vma);
215215
void i915_vma_revoke_mmap(struct i915_vma *vma);
216-
void vma_invalidate_tlb(struct i915_address_space *vm, u32 tlb);
216+
void vma_invalidate_tlb(struct i915_address_space *vm, u32 *tlb);
217217
struct dma_fence *__i915_vma_evict(struct i915_vma *vma, bool async);
218218
int __i915_vma_unbind(struct i915_vma *vma);
219219
int __must_check i915_vma_unbind(struct i915_vma *vma);

0 commit comments

Comments
 (0)