Skip to content

Commit 3cb9d24

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") Signed-off-by: Evan Quan <[email protected]> Reported-by: Dirk Gouders <[email protected]> Acked-by: Nirmoy Das <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 9142c41 commit 3cb9d24

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

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

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

1022+
/*
1023+
* Set initialized values (get from vbios) to dpm tables context such as
1024+
* gfxclk, memclk, dcefclk, and etc. And enable the DPM feature for each
1025+
* type of clks.
1026+
*/
1027+
ret = smu_set_default_dpm_table(smu);
1028+
if (ret) {
1029+
dev_err(adev->dev, "Failed to setup default dpm clock tables!\n");
1030+
return ret;
1031+
}
1032+
10331033
ret = smu_notify_display_change(smu);
10341034
if (ret)
10351035
return ret;

0 commit comments

Comments
 (0)