提交 94561899 编写于 作者: D Dennis Li 提交者: Alex Deucher

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: NNirmoy Das <nirmoy.das@amd.com>
Reviewed-by: NLuben Tuikov <luben.tuikov@amd.com>
Signed-off-by: NDennis Li <Dennis.Li@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 520f5e42
...@@ -632,13 +632,14 @@ int amdgpu_amdkfd_submit_ib(struct kgd_dev *kgd, enum kgd_engine_type engine, ...@@ -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); ret = amdgpu_ib_schedule(ring, 1, ib, job, &f);
up_read(&adev->reset_sem);
if (ret) { if (ret) {
DRM_ERROR("amdgpu: failed to schedule IB.\n"); DRM_ERROR("amdgpu: failed to schedule IB.\n");
goto err_ib_sched; goto err_ib_sched;
} }
up_read(&adev->reset_sem);
ret = dma_fence_wait(f, false); ret = dma_fence_wait(f, false);
err_ib_sched: err_ib_sched:
......
...@@ -545,7 +545,7 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev) ...@@ -545,7 +545,7 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev)
} }
ret = amdgpu_xgmi_update_topology(hive, tmp_adev); ret = amdgpu_xgmi_update_topology(hive, tmp_adev);
if (ret) if (ret)
goto exit; goto exit_unlock;
} }
/* get latest topology info for each device from psp */ /* get latest topology info for each device from psp */
...@@ -558,7 +558,7 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev) ...@@ -558,7 +558,7 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev)
tmp_adev->gmc.xgmi.node_id, tmp_adev->gmc.xgmi.node_id,
tmp_adev->gmc.xgmi.hive_id, ret); tmp_adev->gmc.xgmi.hive_id, ret);
/* To do : continue with some node failed or disable the whole hive */ /* To do : continue with some node failed or disable the whole hive */
goto exit; goto exit_unlock;
} }
} }
} }
...@@ -566,7 +566,7 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev) ...@@ -566,7 +566,7 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev)
if (!ret) if (!ret)
ret = amdgpu_xgmi_sysfs_add_dev_info(adev, hive); ret = amdgpu_xgmi_sysfs_add_dev_info(adev, hive);
exit_unlock:
mutex_unlock(&hive->hive_lock); mutex_unlock(&hive->hive_lock);
exit: exit:
if (!ret) if (!ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册