Commit 8e2712e7 authored by shaoyunl's avatar shaoyunl Committed by Alex Deucher

drm/amdgpu: Add kfd init_complete flag to check from amdgpu side

amdgpu driver may be in reset state during init which will not initialize the kfd,
driver need to initialize the KFD after reset by check the flag
Signed-off-by: default avatarshaoyunl <shaoyun.liu@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 03597b47
...@@ -165,7 +165,8 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev) ...@@ -165,7 +165,8 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev)
adev->doorbell_index.last_non_cp; adev->doorbell_index.last_non_cp;
} }
kgd2kfd_device_init(adev->kfd.dev, adev_to_drm(adev), &gpu_resources); adev->kfd.init_complete = kgd2kfd_device_init(adev->kfd.dev,
adev_to_drm(adev), &gpu_resources);
} }
} }
......
...@@ -80,6 +80,7 @@ struct amdgpu_amdkfd_fence { ...@@ -80,6 +80,7 @@ struct amdgpu_amdkfd_fence {
struct amdgpu_kfd_dev { struct amdgpu_kfd_dev {
struct kfd_dev *dev; struct kfd_dev *dev;
uint64_t vram_used; uint64_t vram_used;
bool init_complete;
}; };
enum kgd_engine_type { enum kgd_engine_type {
......
...@@ -4835,9 +4835,16 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, ...@@ -4835,9 +4835,16 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
skip_sched_resume: skip_sched_resume:
list_for_each_entry(tmp_adev, device_list_handle, gmc.xgmi.head) { list_for_each_entry(tmp_adev, device_list_handle, gmc.xgmi.head) {
/*unlock kfd: SRIOV would do it separately */ /* unlock kfd: SRIOV would do it separately */
if (!need_emergency_restart && !amdgpu_sriov_vf(tmp_adev)) if (!need_emergency_restart && !amdgpu_sriov_vf(tmp_adev))
amdgpu_amdkfd_post_reset(tmp_adev); amdgpu_amdkfd_post_reset(tmp_adev);
/* kfd_post_reset will do nothing if kfd device is not initialized,
* need to bring up kfd here if it's not be initialized before
*/
if (!adev->kfd.init_complete)
amdgpu_amdkfd_device_init(adev);
if (audio_suspended) if (audio_suspended)
amdgpu_device_resume_display_audio(tmp_adev); amdgpu_device_resume_display_audio(tmp_adev);
amdgpu_device_unlock_adev(tmp_adev); amdgpu_device_unlock_adev(tmp_adev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment