Skip to content

Commit 428890a

Browse files
shaoyunlalexdeucher
authored andcommitted
drm/amdgpu: adjust the kfd reset sequence in reset sriov function
This change revert previous commits: 9f4f2c1 ("drm/amd/amdgpu: fix the kfd pre_reset sequence in sriov") 271fd38 ("drm/amdgpu: move kfd post_reset out of reset_sriov function") This change moves the amdgpu_amdkfd_pre_reset to an earlier place in amdgpu_device_reset_sriov, presumably to address the sequence issue that the first patch was originally meant to fix. Some register access(GRBM_GFX_CNTL) only be allowed on full access mode. Move kfd_pre_reset and kfd_post_reset back inside reset_sriov function. Fixes: 9f4f2c1 ("drm/amd/amdgpu: fix the kfd pre_reset sequence in sriov") Fixes: 271fd38 ("drm/amdgpu: move kfd post_reset out of reset_sriov function") Signed-off-by: shaoyunl <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 2da34b7 commit 428890a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4289,6 +4289,8 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev,
42894289
{
42904290
int r;
42914291

4292+
amdgpu_amdkfd_pre_reset(adev);
4293+
42924294
if (from_hypervisor)
42934295
r = amdgpu_virt_request_full_gpu(adev, true);
42944296
else
@@ -4316,6 +4318,7 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev,
43164318

43174319
amdgpu_irq_gpu_reset_resume_helper(adev);
43184320
r = amdgpu_ib_ring_tests(adev);
4321+
amdgpu_amdkfd_post_reset(adev);
43194322

43204323
error:
43214324
if (!r && adev->virt.gim_feature & AMDGIM_FEATURE_GIM_FLR_VRAMLOST) {
@@ -5030,7 +5033,8 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
50305033

50315034
cancel_delayed_work_sync(&tmp_adev->delayed_init_work);
50325035

5033-
amdgpu_amdkfd_pre_reset(tmp_adev);
5036+
if (!amdgpu_sriov_vf(tmp_adev))
5037+
amdgpu_amdkfd_pre_reset(tmp_adev);
50345038

50355039
/*
50365040
* Mark these ASICs to be reseted as untracked first
@@ -5148,9 +5152,9 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
51485152

51495153
skip_sched_resume:
51505154
list_for_each_entry(tmp_adev, device_list_handle, reset_list) {
5151-
/* unlock kfd */
5152-
if (!need_emergency_restart)
5153-
amdgpu_amdkfd_post_reset(tmp_adev);
5155+
/* unlock kfd: SRIOV would do it separately */
5156+
if (!need_emergency_restart && !amdgpu_sriov_vf(tmp_adev))
5157+
amdgpu_amdkfd_post_reset(tmp_adev);
51545158

51555159
/* kfd_post_reset will do nothing if kfd device is not initialized,
51565160
* need to bring up kfd here if it's not be initialized before

0 commit comments

Comments
 (0)