diff options
author | Likun Gao <Likun.Gao@amd.com> | 2019-08-15 15:46:10 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-05-01 15:19:07 -0400 |
commit | 98bf250edd64344124fe5f619d6320d02e17af5e (patch) | |
tree | 8e5ae1ade544e2054963d7b036827c8a4b8cbd98 | |
parent | 68a9fb4d2980d242b600ff9c0728490b44003dd3 (diff) | |
download | linux-stable-98bf250edd64344124fe5f619d6320d02e17af5e.tar.gz linux-stable-98bf250edd64344124fe5f619d6320d02e17af5e.tar.bz2 linux-stable-98bf250edd64344124fe5f619d6320d02e17af5e.zip |
drm/amdgpu: check SMU NULL ptr on gfx hw init
Check SMU NULL ptr before load smu fw.
Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index 9fe20b782e88..04c5c8d257a3 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -6540,14 +6540,16 @@ static int gfx_v10_0_hw_init(void *handle) * loaded firstly, so in direct type, it has to load smc ucode * here before rlc. */ - r = smu_load_microcode(&adev->smu); - if (r) - return r; + if (adev->smu.ppt_funcs != NULL) { + r = smu_load_microcode(&adev->smu); + if (r) + return r; - r = smu_check_fw_status(&adev->smu); - if (r) { - pr_err("SMC firmware status is not correct\n"); - return r; + r = smu_check_fw_status(&adev->smu); + if (r) { + pr_err("SMC firmware status is not correct\n"); + return r; + } } } |