提交 05188312 编写于 作者: A Alex Deucher

drm/amdgpu/cz: don't call smu_init on resume

smu_init allocates buffers and initializes them.  It does not
touch the hw.  There is no need to do it again on resume.  It
should really be part of sw_init (and smu_fini should be part
of sw_fini), but we need the firmware sizes from the other IPs
for firmware loading so we have to wait until sw init is done
for all other IPs.
Reviewed-by: NSonny Jiang <Sonny.Jiang@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 6a00a09e
...@@ -1230,7 +1230,10 @@ static int cz_dpm_hw_init(void *handle) ...@@ -1230,7 +1230,10 @@ static int cz_dpm_hw_init(void *handle)
mutex_lock(&adev->pm.mutex); mutex_lock(&adev->pm.mutex);
/* init smc in dpm hw init */ /* smu init only needs to be called at startup, not resume.
* It should be in sw_init, but requires the fw info gathered
* in sw_init from other IP modules.
*/
ret = cz_smu_init(adev); ret = cz_smu_init(adev);
if (ret) { if (ret) {
DRM_ERROR("amdgpu: smc initialization failed\n"); DRM_ERROR("amdgpu: smc initialization failed\n");
...@@ -1297,6 +1300,10 @@ static int cz_dpm_hw_fini(void *handle) ...@@ -1297,6 +1300,10 @@ static int cz_dpm_hw_fini(void *handle)
mutex_lock(&adev->pm.mutex); mutex_lock(&adev->pm.mutex);
/* smu fini only needs to be called at teardown, not suspend.
* It should be in sw_fini, but we put it here for symmetry
* with smu init.
*/
cz_smu_fini(adev); cz_smu_fini(adev);
if (adev->pm.dpm_enabled) { if (adev->pm.dpm_enabled) {
...@@ -1340,12 +1347,6 @@ static int cz_dpm_resume(void *handle) ...@@ -1340,12 +1347,6 @@ static int cz_dpm_resume(void *handle)
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
mutex_lock(&adev->pm.mutex); mutex_lock(&adev->pm.mutex);
ret = cz_smu_init(adev);
if (ret) {
DRM_ERROR("amdgpu: smc resume failed\n");
mutex_unlock(&adev->pm.mutex);
return ret;
}
/* do the actual fw loading */ /* do the actual fw loading */
ret = cz_smu_start(adev); ret = cz_smu_start(adev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册