mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 15:12:13 +02:00
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>
This commit is contained in:
parent
3d9eea6d00
commit
30f2daedf4
|
|
@ -35,6 +35,7 @@ static int amdgpu_benchmark_do_move(struct amdgpu_device *adev, unsigned size,
|
||||||
struct dma_fence *fence;
|
struct dma_fence *fence;
|
||||||
int i, r;
|
int i, r;
|
||||||
|
|
||||||
|
mutex_lock(&adev->mman.default_entity.lock);
|
||||||
stime = ktime_get();
|
stime = ktime_get();
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
r = amdgpu_copy_buffer(adev, &adev->mman.default_entity,
|
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)
|
if (r)
|
||||||
goto exit_do_move;
|
goto exit_do_move;
|
||||||
}
|
}
|
||||||
|
mutex_unlock(&adev->mman.default_entity.lock);
|
||||||
|
|
||||||
exit_do_move:
|
exit_do_move:
|
||||||
etime = ktime_get();
|
etime = ktime_get();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user