Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c83e77a authored by Rex Zhu's avatar Rex Zhu Committed by Greg Kroah-Hartman
Browse files

drm/amdgpu: Update power state at the end of smu hw_init.



[ Upstream commit 2ab4d0e74256fc49b7b270f63c1d1e47c2455abc ]

For SI/Kv, the power state is managed by function
amdgpu_pm_compute_clocks.

when dpm enabled, we should call amdgpu_pm_compute_clocks
to update current power state instand of set boot state.

this change can fix the oops when kfd driver was enabled on Kv.

Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Tested-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d79d8b59
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1350,8 +1350,6 @@ static int kv_dpm_enable(struct amdgpu_device *adev)
		return ret;
	}

	kv_update_current_ps(adev, adev->pm.dpm.boot_ps);

	if (adev->irq.installed &&
	    amdgpu_is_internal_thermal_sensor(adev->pm.int_thermal_type)) {
		ret = kv_set_thermal_temperature_range(adev, KV_TEMP_RANGE_MIN, KV_TEMP_RANGE_MAX);
@@ -3086,7 +3084,7 @@ static int kv_dpm_hw_init(void *handle)
	else
		adev->pm.dpm_enabled = true;
	mutex_unlock(&adev->pm.mutex);

	amdgpu_pm_compute_clocks(adev);
	return ret;
}

+1 −2
Original line number Diff line number Diff line
@@ -6959,7 +6959,6 @@ static int si_dpm_enable(struct amdgpu_device *adev)

	si_enable_auto_throttle_source(adev, AMDGPU_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
	si_thermal_start_thermal_controller(adev);
	ni_update_current_ps(adev, boot_ps);

	return 0;
}
@@ -7836,7 +7835,7 @@ static int si_dpm_hw_init(void *handle)
	else
		adev->pm.dpm_enabled = true;
	mutex_unlock(&adev->pm.mutex);

	amdgpu_pm_compute_clocks(adev);
	return ret;
}