summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
diff options
context:
space:
mode:
authorDennis Li <Dennis.Li@amd.com>2020-08-04 07:32:13 +0300
committerAlex Deucher <alexander.deucher@amd.com>2020-08-08 00:31:26 +0300
commit94561899ddb0f89d7fd3fb58ee3ed6961ef048ad (patch)
tree56b6582786f13a378395cab910427f411dc37937 /drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
parent520f5e425a69417540b7563c266f773752dcea44 (diff)
downloadlinux-94561899ddb0f89d7fd3fb58ee3ed6961ef048ad.tar.xz
drm/amdgpu: unlock mutex on error
Make sure to unlock the mutex when error happen v2: 1. correct syntax error in the commit comments 2. remove change-Id Acked-by: Nirmoy Das <nirmoy.das@amd.com> Reviewed-by: Luben Tuikov <luben.tuikov@amd.com> Signed-off-by: Dennis Li <Dennis.Li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
index 92790db5edc0..9738dccb1c2c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
@@ -632,13 +632,14 @@ int amdgpu_amdkfd_submit_ib(struct kgd_dev *kgd, enum kgd_engine_type engine,
}
ret = amdgpu_ib_schedule(ring, 1, ib, job, &f);
+
+ up_read(&adev->reset_sem);
+
if (ret) {
DRM_ERROR("amdgpu: failed to schedule IB.\n");
goto err_ib_sched;
}
- up_read(&adev->reset_sem);
-
ret = dma_fence_wait(f, false);
err_ib_sched: