Commit 3b37e272 authored by Yifan Zhang's avatar Yifan Zhang Committed by Alex Deucher

drm/amdgpu: skip kfd init if GFX is not ready.

avoid kfd init crash in that case.
Signed-off-by: default avatarYifan Zhang <yifan1.zhang@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Tested-by: default avatarJesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: default avatarJesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 305cd109
...@@ -2471,6 +2471,7 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev) ...@@ -2471,6 +2471,7 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
*/ */
static int amdgpu_device_ip_early_init(struct amdgpu_device *adev) static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
{ {
struct amdgpu_ip_block *ip_block;
struct pci_dev *parent; struct pci_dev *parent;
int i, r; int i, r;
bool total; bool total;
...@@ -2608,7 +2609,10 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev) ...@@ -2608,7 +2609,10 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
if (!total) if (!total)
return -ENODEV; return -ENODEV;
ip_block = amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_GFX);
if (ip_block->status.valid != false)
amdgpu_amdkfd_device_probe(adev); amdgpu_amdkfd_device_probe(adev);
adev->cg_flags &= amdgpu_cg_mask; adev->cg_flags &= amdgpu_cg_mask;
adev->pg_flags &= amdgpu_pg_mask; adev->pg_flags &= amdgpu_pg_mask;
......
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