1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-18 15:23:33 +02:00

drm/amdgpu: gate VM CPU HDP flush on reset lock

From Chenglei Xie
f34eda3ff33d351a9d9c078420cbe1bd258b413e in linux-6.18.y/6.18.32
ddda81c4d7e71e41b1be91d921fd85747eddbd12 in mainline linux
This commit is contained in:
jsg
2026-05-18 01:22:31 +00:00
parent 0832f67301
commit 453e3248fd
+11 -1
View File
@@ -21,6 +21,8 @@
*/
#include "amdgpu_vm.h"
#include "amdgpu.h"
#include "amdgpu_reset.h"
#include "amdgpu_object.h"
#include "amdgpu_trace.h"
@@ -108,11 +110,19 @@ static int amdgpu_vm_cpu_update(struct amdgpu_vm_update_params *p,
static int amdgpu_vm_cpu_commit(struct amdgpu_vm_update_params *p,
struct dma_fence **fence)
{
struct amdgpu_device *adev = p->adev;
if (p->needs_flush)
atomic64_inc(&p->vm->tlb_seq);
mb();
amdgpu_device_flush_hdp(p->adev, NULL);
/* A reset flushed the HDP anyway, so that here can be skipped when a reset is ongoing */
if (!down_read_trylock(&adev->reset_domain->sem))
return 0;
amdgpu_device_flush_hdp(adev, NULL);
up_read(&adev->reset_domain->sem);
return 0;
}