Commit 3cb9d241 authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

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: 02cf91c1 ("drm/amd/powerplay: postpone operations not required for hw setup to late_init")
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reported-by: default avatarDirk Gouders <dirk@gouders.net>
Acked-by: default avatarNirmoy Das <nirmoy.das@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 9142c413
...@@ -481,17 +481,6 @@ static int smu_late_init(void *handle) ...@@ -481,17 +481,6 @@ static int smu_late_init(void *handle)
return ret; return ret;
} }
/*
* Set initialized values (get from vbios) to dpm tables context such as
* gfxclk, memclk, dcefclk, and etc. And enable the DPM feature for each
* type of clks.
*/
ret = smu_set_default_dpm_table(smu);
if (ret) {
dev_err(adev->dev, "Failed to setup default dpm clock tables!\n");
return ret;
}
ret = smu_populate_umd_state_clk(smu); ret = smu_populate_umd_state_clk(smu);
if (ret) { if (ret) {
dev_err(adev->dev, "Failed to populate UMD state clocks!\n"); 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) ...@@ -1030,6 +1019,17 @@ static int smu_smc_hw_setup(struct smu_context *smu)
return ret; return ret;
} }
/*
* Set initialized values (get from vbios) to dpm tables context such as
* gfxclk, memclk, dcefclk, and etc. And enable the DPM feature for each
* type of clks.
*/
ret = smu_set_default_dpm_table(smu);
if (ret) {
dev_err(adev->dev, "Failed to setup default dpm clock tables!\n");
return ret;
}
ret = smu_notify_display_change(smu); ret = smu_notify_display_change(smu);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment