FAILED: patch "[PATCH] drm/amdgpu: workaround for TLB seq race" failed to apply to 6.1-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
Possible dependencies:
f9e694964503 ("drm/amdgpu: workaround for TLB seq race")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From f9e69496450352fa0504fd5a8fd9134b31116558 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <[email protected]>
Date: Wed, 2 Nov 2022 14:55:13 +0100
Subject: [PATCH] drm/amdgpu: workaround for TLB seq race
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
It can happen that we query the sequence value before the callback had a chance to run.
Workaround that by grabbing the fence lock and releasing it again. Should be replaced by hw handling soon.
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +15 -0
@@ -492,6 +492,21 @@ void amdgpu_debugfs_vm_bo_info(struct amdgpu_vm *vm, struct seq_file *m);*/ static inline uint64_t amdgpu_vm_tlb_seq (struct amdgpu_vm *vm) { +unsigned long flags; +spinlock_t *lock; + +/* +* Workaround to stop racing between the fence signaling and handling +* the cb. The lock is static after initially setting it up, just make +* sure that the dma_fence structure isn't freed up. +*/ +rcu_read_lock (); + lock = vm->last_tlb_flush->lock; +rcu_read_unlock (); + +spin_lock_irqsave (lock, flags); +spin_unlock_irqrestore (lock, flags); +return atomic64_read (&vm->tlb_seq); }