]> Git Repo - linux.git/commitdiff
drm/amdgpu: check SMU NULL ptr on gfx hw init
authorLikun Gao <[email protected]>
Thu, 15 Aug 2019 07:46:10 +0000 (15:46 +0800)
committerAlex Deucher <[email protected]>
Fri, 1 May 2020 19:19:07 +0000 (15:19 -0400)
Check SMU NULL ptr before load smu fw.

Signed-off-by: Likun Gao <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c

index 9fe20b782e88d0fe30150eab8134746a404a3096..04c5c8d257a3e48f73be948f620e2de8897f825f 100644 (file)
@@ -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;
+                       }
                }
        }
 
This page took 0.050481 seconds and 4 git commands to generate.