summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>2025-11-18 15:15:04 +0100
committerAlex Deucher <alexander.deucher@amd.com>2026-02-23 14:16:30 -0500
commit30f2daedf4d8adfa331b05fcce06746e643e1f18 (patch)
tree586de4ad89d365510e8100c33307ecca5593377a /drivers/gpu/drm/amd
parent3d9eea6d000b34a087d02b1614931cff039d7f26 (diff)
downloadlinux-30f2daedf4d8adfa331b05fcce06746e643e1f18.tar.gz
linux-30f2daedf4d8adfa331b05fcce06746e643e1f18.zip
drm/amdgpu: add missing lock in amdgpu_benchmark_do_move
Taking the entity lock is required to guarantee the ordering of execution. The next commit will add a check that the lock is held. Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
index 1cbba9803d31..98ccd7ab9e9a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
@@ -35,6 +35,7 @@ static int amdgpu_benchmark_do_move(struct amdgpu_device *adev, unsigned size,
struct dma_fence *fence;
int i, r;
+ mutex_lock(&adev->mman.default_entity.lock);
stime = ktime_get();
for (i = 0; i < n; i++) {
r = amdgpu_copy_buffer(adev, &adev->mman.default_entity,
@@ -47,6 +48,7 @@ static int amdgpu_benchmark_do_move(struct amdgpu_device *adev, unsigned size,
if (r)
goto exit_do_move;
}
+ mutex_unlock(&adev->mman.default_entity.lock);
exit_do_move:
etime = ktime_get();