Skip to content

Commit

Permalink
drm/amd/pm: setup APU dpm clock table in SMU HW initialization
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Evan Quan <[email protected]>
Reported-by: Dirk Gouders <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
  • Loading branch information
Evan Quan authored and alexdeucher committed Sep 30, 2020
1 parent 548c7ba commit b195152
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,17 +479,6 @@ static int smu_late_init(void *handle)
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);
if (ret) {
dev_err(adev->dev, "Failed to populate UMD state clocks!\n");
Expand Down Expand Up @@ -984,6 +973,17 @@ static int smu_smc_hw_setup(struct smu_context *smu)
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);
if (ret)
return ret;
Expand Down

0 comments on commit b195152

Please sign in to comment.