drm/amd/amdgpu: fix the kfd pre_reset sequence in sriov
Subsystems (2)
PATCH 1/1 drm/amd/amdgpu: fix the kfd pre_reset sequence in sriov
The KFD pre_reset should be called before reset been executed, it will hold the lock to prevent other rocm process to sent the packlage to hiq during host execute the real reset on the HW
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -4
@@ -4278,8 +4278,6 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev,if (r)return r; -amdgpu_amdkfd_pre_reset (adev); -/* Resume IP prior to SMC */ r =amdgpu_device_ip_reinit_early_sriov (adev);if (r)
@@ -5015,8 +5013,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,cancel_delayed_work_sync (&tmp_adev->delayed_init_work); -if (!amdgpu_sriov_vf (tmp_adev)) -amdgpu_amdkfd_pre_reset (tmp_adev); +amdgpu_amdkfd_pre_reset (tmp_adev);/* * Mark these ASICs to be reseted as untracked first
Signature · 1 line
2.17.1
There was a reason why pre_reset was done differently on SRIOV. However, the code has changed a lot since then. Is this concern still valid?
Quoted 6 lines
commit
7b184b006185215daf4e911f8de212964c99a514
Author: wentalou <[email protected]>
Date: Fri Dec 7 13:53:18 2018 +0800drm/amdgpu:
kfd_pre_resetoutsidereq_full_gpucause sriov hang
Quoted 7 lines
XGMI hive put
kfd_pre_resetintoamdgpu_device_lock_adev, but outsidereq_full_gpuof sriov.
It would make sriov hang during reset.Signed-off-by Wentao Lou <[email protected]>Reviewed-by Shaoyun Liu <[email protected]>Signed-off-by Alex Deucher <[email protected]>
Regards,
Felix
Quoted 32 lines · shaoyunl
The KFD
pre_resetshould be called before reset been executed, it will hold the lock to prevent other rocm process to sent the packlage to hiq during host execute the real reset on the HWSigned-off-by shaoyunl <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-4@@ -4278,8 +4278,6 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev,if (r)return r; -amdgpu_amdkfd_pre_reset (adev); -/* Resume IP prior to SMC */ r =amdgpu_device_ip_reinit_early_sriov (adev);if (r)@@ -5015,8 +5013,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,cancel_delayed_work_sync (&tmp_adev->delayed_init_work); -if (!amdgpu_sriov_vf (tmp_adev)) -amdgpu_amdkfd_pre_reset (tmp_adev); +amdgpu_amdkfd_pre_reset (tmp_adev);/* * Mark these ASICs to be reseted as untracked first
[AMD Official Use Only]
Ye, a lot already been changed since then , now the pre_reset and post_reset not in the lock/unlock anymore. With my previous change , we make kfd_pre_reset avoid touch HW . Now it's pure SW handling , should be safe to be moved out of the full access . Anyway, thanks to bring this up, it will remind us to verify on the XGMI configuration on SRIOV.
Regards
shaoyun.liu
-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Friday, November 5, 2021 1:48 PM
To: Liu, Shaoyun <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amd/amdgpu: fix the kfd pre_reset sequence in sriov
There was a reason why pre_reset was done differently on SRIOV. However, the code has changed a lot since then. Is this concern still valid?
Quoted 6 lines
commit
7b184b006185215daf4e911f8de212964c99a514
Author: wentalou <[email protected]>
Date: Fri Dec 7 13:53:18 2018 +0800drm/amdgpu:
kfd_pre_resetoutsidereq_full_gpucause sriov hang
Quoted 7 lines
XGMI hive put
kfd_pre_resetintoamdgpu_device_lock_adev, but outsidereq_full_gpuof sriov.
It would make sriov hang during reset.Signed-off-by Wentao Lou <[email protected]>Reviewed-by Shaoyun Liu <[email protected]>Signed-off-by Alex Deucher <[email protected]>
Regards,
Felix
Quoted 34 lines · shaoyunl
The KFD
pre_resetshould be called before reset been executed, it will hold the lock to prevent other rocm process to sent the packlage to hiq during host execute the real reset on the HWSigned-off-by shaoyunl <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-4@@ -4278,8 +4278,6 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev,if (r)return r; -amdgpu_amdkfd_pre_reset (adev); -/* Resume IP prior to SMC */ r =amdgpu_device_ip_reinit_early_sriov (adev);if (r)@@ -5015,8 +5013,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,cancel_delayed_work_sync (&tmp_adev->delayed_init_work); -if (!amdgpu_sriov_vf (tmp_adev)) -amdgpu_amdkfd_pre_reset (tmp_adev); +amdgpu_amdkfd_pre_reset (tmp_adev);/* * Mark these ASICs to be reseted as untracked first
Felix Kuehling
Reviewed-byQuoted 4 lines · Shaoyun
[AMD Official Use Only]
Ye, a lot already been changed since then , now the
pre_resetandpost_resetnot in the lock/unlock anymore. With my previous change , we makekfd_pre_resetavoid touch HW . Now it's pure SW handling , should be safe to be moved out of the full access . Anyway, thanks to bring this up, it will remind us to verify on the XGMI configuration on SRIOV.
OK. Assuming it doesn't break in your testing, consider the patch
Quoted 64 lines
Regards
shaoyun.liu-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Friday, November 5, 2021 1:48 PM
To: Liu, Shaoyun <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amd/amdgpu: fix the kfdpre_resetsequence in sriovThere was a reason why
pre_resetwas done differently on SRIOV. However, the code has changed a lot since then. Is this concern still valid?Quoted 6 lines
commit
7b184b006185215daf4e911f8de212964c99a514
Author: wentalou <[email protected]>
Date: Fri Dec 7 13:53:18 2018 +0800drm/amdgpu:
kfd_pre_resetoutsidereq_full_gpucause sriov hangQuoted 7 lines
XGMI hive put
kfd_pre_resetintoamdgpu_device_lock_adev, but outsidereq_full_gpuof sriov.
It would make sriov hang during reset.Signed-off-by Wentao Lou <[email protected]>Reviewed-by Shaoyun Liu <[email protected]>Signed-off-by Alex Deucher <[email protected]>Regards,
FelixQuoted 34 lines · shaoyunl
The KFD
pre_resetshould be called before reset been executed, it will hold the lock to prevent other rocm process to sent the packlage to hiq during host execute the real reset on the HWSigned-off-by shaoyunl <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-4@@ -4278,8 +4278,6 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev,if (r)return r; -amdgpu_amdkfd_pre_reset (adev); -/* Resume IP prior to SMC */ r =amdgpu_device_ip_reinit_early_sriov (adev);if (r)@@ -5015,8 +5013,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,cancel_delayed_work_sync (&tmp_adev->delayed_init_work); -if (!amdgpu_sriov_vf (tmp_adev)) -amdgpu_amdkfd_pre_reset (tmp_adev); +amdgpu_amdkfd_pre_reset (tmp_adev);/* * Mark these ASICs to be reseted as untracked first