Commit b1951525 authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher
Browse files

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")
Acked-by: default avatarNirmoy Das <nirmoy.das@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reported-by: default avatarDirk Gouders <dirk@gouders.net>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 548c7ba7
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -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");
@@ -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;