From: Likun Gao Date: Thu, 15 Aug 2019 07:46:10 +0000 (+0800) Subject: drm/amdgpu: check SMU NULL ptr on gfx hw init X-Git-Tag: baikal/mips/sdk5.9~13559^2~11^2~59 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=011b4cca1fd3fa5d637279ff073e0c95bb3d903d;p=kernel.git drm/amdgpu: check SMU NULL ptr on gfx hw init Check SMU NULL ptr before load smu fw. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index 9fe20b782e88d..04c5c8d257a3e 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; + } } }