diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2015-06-09 17:42:10 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-06-10 09:32:19 -0400 |
commit | aaf4ee3c0233893ac9586ede9cdcaa4a77ccb475 (patch) | |
tree | 62375d41ef53766bc10333501beac7a6348f02af | |
parent | 05188312e2ea8991c75bc4ae947d4dc1e7a3bb17 (diff) |
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>
-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 2d5b1bd52afa..204903897b4f 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) | |||
81 | 81 | ||
82 | mutex_lock(&adev->pm.mutex); | 82 | mutex_lock(&adev->pm.mutex); |
83 | 83 | ||
84 | /* smu init only needs to be called at startup, not resume. | ||
85 | * It should be in sw_init, but requires the fw info gathered | ||
86 | * in sw_init from other IP modules. | ||
87 | */ | ||
84 | ret = tonga_smu_init(adev); | 88 | ret = tonga_smu_init(adev); |
85 | if (ret) { | 89 | if (ret) { |
86 | DRM_ERROR("SMU initialization failed\n"); | 90 | DRM_ERROR("SMU initialization failed\n"); |
@@ -107,6 +111,10 @@ static int tonga_dpm_hw_fini(void *handle) | |||
107 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 111 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
108 | 112 | ||
109 | mutex_lock(&adev->pm.mutex); | 113 | mutex_lock(&adev->pm.mutex); |
114 | /* smu fini only needs to be called at teardown, not suspend. | ||
115 | * It should be in sw_fini, but we put it here for symmetry | ||
116 | * with smu init. | ||
117 | */ | ||
110 | tonga_smu_fini(adev); | 118 | tonga_smu_fini(adev); |
111 | mutex_unlock(&adev->pm.mutex); | 119 | mutex_unlock(&adev->pm.mutex); |
112 | return 0; | 120 | return 0; |
@@ -114,20 +122,25 @@ static int tonga_dpm_hw_fini(void *handle) | |||
114 | 122 | ||
115 | static int tonga_dpm_suspend(void *handle) | 123 | static int tonga_dpm_suspend(void *handle) |
116 | { | 124 | { |
117 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | ||
118 | |||
119 | tonga_dpm_hw_fini(adev); | ||
120 | |||
121 | return 0; | 125 | return 0; |
122 | } | 126 | } |
123 | 127 | ||
124 | static int tonga_dpm_resume(void *handle) | 128 | static int tonga_dpm_resume(void *handle) |
125 | { | 129 | { |
130 | int ret; | ||
126 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 131 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
127 | 132 | ||
128 | tonga_dpm_hw_init(adev); | 133 | mutex_lock(&adev->pm.mutex); |
129 | 134 | ||
130 | return 0; | 135 | ret = tonga_smu_start(adev); |
136 | if (ret) { | ||
137 | DRM_ERROR("SMU start failed\n"); | ||
138 | goto fail; | ||
139 | } | ||
140 | |||
141 | fail: | ||
142 | mutex_unlock(&adev->pm.mutex); | ||
143 | return ret; | ||
131 | } | 144 | } |
132 | 145 | ||
133 | static int tonga_dpm_set_clockgating_state(void *handle, | 146 | static int tonga_dpm_set_clockgating_state(void *handle, |