diff options
author | wentalou <Wentao.Lou@amd.com> | 2018-12-07 00:53:18 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-12-14 12:04:38 -0500 |
commit | 7b184b006185215daf4e911f8de212964c99a514 (patch) | |
tree | bd6b0c211f2567bdc015da9b9b087881dae0da64 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |
parent | 2a3c83f5fe0770d13bbb71b23674886ff4111f44 (diff) |
drm/amdgpu: kfd_pre_reset outside req_full_gpu cause sriov hang
XGMI hive put kfd_pre_reset into amdgpu_device_lock_adev,
but outside req_full_gpu of sriov.
It would make sriov hang during reset.
Signed-off-by: Wentao Lou <Wentao.Lou@amd.com>
Reviewed-by: Shaoyun Liu <Shaoyun.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index b60afeade50a..8a078f4ae73d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
@@ -3476,14 +3476,16 @@ static void amdgpu_device_lock_adev(struct amdgpu_device *adev) | |||
3476 | mutex_lock(&adev->lock_reset); | 3476 | mutex_lock(&adev->lock_reset); |
3477 | atomic_inc(&adev->gpu_reset_counter); | 3477 | atomic_inc(&adev->gpu_reset_counter); |
3478 | adev->in_gpu_reset = 1; | 3478 | adev->in_gpu_reset = 1; |
3479 | /* Block kfd */ | 3479 | /* Block kfd: SRIOV would do it separately */ |
3480 | amdgpu_amdkfd_pre_reset(adev); | 3480 | if (!amdgpu_sriov_vf(adev)) |
3481 | amdgpu_amdkfd_pre_reset(adev); | ||
3481 | } | 3482 | } |
3482 | 3483 | ||
3483 | static void amdgpu_device_unlock_adev(struct amdgpu_device *adev) | 3484 | static void amdgpu_device_unlock_adev(struct amdgpu_device *adev) |
3484 | { | 3485 | { |
3485 | /*unlock kfd */ | 3486 | /*unlock kfd: SRIOV would do it separately */ |
3486 | amdgpu_amdkfd_post_reset(adev); | 3487 | if (!amdgpu_sriov_vf(adev)) |
3488 | amdgpu_amdkfd_post_reset(adev); | ||
3487 | amdgpu_vf_error_trans_all(adev); | 3489 | amdgpu_vf_error_trans_all(adev); |
3488 | adev->in_gpu_reset = 0; | 3490 | adev->in_gpu_reset = 0; |
3489 | mutex_unlock(&adev->lock_reset); | 3491 | mutex_unlock(&adev->lock_reset); |