diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2015-06-09 21:42:10 (GMT) |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-06-10 13:32:19 (GMT) |
commit | aaf4ee3c0233893ac9586ede9cdcaa4a77ccb475 (patch) | |
tree | 62375d41ef53766bc10333501beac7a6348f02af /drivers/gpu/drm/amd | |
parent | 05188312e2ea8991c75bc4ae947d4dc1e7a3bb17 (diff) | |
download | linux-aaf4ee3c0233893ac9586ede9cdcaa4a77ccb475.tar.xz |
drm/amdgpu/tonga: 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: Sonny Jiang <Sonny.Jiang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/tonga_dpm.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/tonga_dpm.c b/drivers/gpu/drm/amd/amdgpu/tonga_dpm.c index 2d5b1bd..2049038 100644 --- a/drivers/gpu/drm/amd/amdgpu/tonga_dpm.c +++ b/drivers/gpu/drm/amd/amdgpu/tonga_dpm.c @@ -81,6 +81,10 @@ static int tonga_dpm_hw_init(void *handle) mutex_lock(&adev->pm.mutex); + /* 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 = tonga_smu_init(adev); if (ret) { DRM_ERROR("SMU initialization failed\n"); @@ -107,6 +111,10 @@ static int tonga_dpm_hw_fini(void *handle) struct amdgpu_device *adev = (struct amdgpu_device *)handle; 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. + */ tonga_smu_fini(adev); mutex_unlock(&adev->pm.mutex); return 0; @@ -114,20 +122,25 @@ static int tonga_dpm_hw_fini(void *handle) static int tonga_dpm_suspend(void *handle) { - struct amdgpu_device *adev = (struct amdgpu_device *)handle; - - tonga_dpm_hw_fini(adev); - return 0; } static int tonga_dpm_resume(void *handle) { + int ret; struct amdgpu_device *adev = (struct amdgpu_device *)handle; - tonga_dpm_hw_init(adev); + mutex_lock(&adev->pm.mutex); - return 0; + ret = tonga_smu_start(adev); + if (ret) { + DRM_ERROR("SMU start failed\n"); + goto fail; + } + +fail: + mutex_unlock(&adev->pm.mutex); + return ret; } static int tonga_dpm_set_clockgating_state(void *handle, |