Skip to content

Commit b195152

Browse files
Evan Quanalexdeucher
authored andcommitted
drm/amd/pm: setup APU dpm clock table in SMU HW initialization
As the dpm clock table is needed during DC HW initialization. And that (DC HW initialization) comes before smu_late_init() where current APU dpm clock table setup is performed. So, NULL pointer dereference will be triggered. By moving APU dpm clock table setup to smu_hw_init(), this can be avoided. Fixes: 02cf91c ("drm/amd/powerplay: postpone operations not required for hw setup to late_init") Acked-by: Nirmoy Das <nirmoy.das@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Evan Quan <evan.quan@amd.com> Reported-by: Dirk Gouders <dirk@gouders.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 548c7ba commit b195152

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -479,17 +479,6 @@ static int smu_late_init(void *handle)
479479
return ret;
480480
}
481481

482-
/*
483-
* Set initialized values (get from vbios) to dpm tables context such as
484-
* gfxclk, memclk, dcefclk, and etc. And enable the DPM feature for each
485-
* type of clks.
486-
*/
487-
ret = smu_set_default_dpm_table(smu);
488-
if (ret) {
489-
dev_err(adev->dev, "Failed to setup default dpm clock tables!\n");
490-
return ret;
491-
}
492-
493482
ret = smu_populate_umd_state_clk(smu);
494483
if (ret) {
495484
dev_err(adev->dev, "Failed to populate UMD state clocks!\n");
@@ -984,6 +973,17 @@ static int smu_smc_hw_setup(struct smu_context *smu)
984973
return ret;
985974
}
986975

976+
/*
977+
* Set initialized values (get from vbios) to dpm tables context such as
978+
* gfxclk, memclk, dcefclk, and etc. And enable the DPM feature for each
979+
* type of clks.
980+
*/
981+
ret = smu_set_default_dpm_table(smu);
982+
if (ret) {
983+
dev_err(adev->dev, "Failed to setup default dpm clock tables!\n");
984+
return ret;
985+
}
986+
987987
ret = smu_notify_display_change(smu);
988988
if (ret)
989989
return ret;

0 commit comments

Comments
 (0)