Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Sonny Jiang <Sonny.Jiang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

+8 -7
+8 -7
drivers/gpu/drm/amd/amdgpu/cz_dpm.c
··· 1230 1230 1231 1231 mutex_lock(&adev->pm.mutex); 1232 1232 1233 - /* init smc in dpm hw init */ 1233 + /* smu init only needs to be called at startup, not resume. 1234 + * It should be in sw_init, but requires the fw info gathered 1235 + * in sw_init from other IP modules. 1236 + */ 1234 1237 ret = cz_smu_init(adev); 1235 1238 if (ret) { 1236 1239 DRM_ERROR("amdgpu: smc initialization failed\n"); ··· 1300 1297 1301 1298 mutex_lock(&adev->pm.mutex); 1302 1299 1300 + /* smu fini only needs to be called at teardown, not suspend. 1301 + * It should be in sw_fini, but we put it here for symmetry 1302 + * with smu init. 1303 + */ 1303 1304 cz_smu_fini(adev); 1304 1305 1305 1306 if (adev->pm.dpm_enabled) { ··· 1347 1340 struct amdgpu_device *adev = (struct amdgpu_device *)handle; 1348 1341 1349 1342 mutex_lock(&adev->pm.mutex); 1350 - ret = cz_smu_init(adev); 1351 - if (ret) { 1352 - DRM_ERROR("amdgpu: smc resume failed\n"); 1353 - mutex_unlock(&adev->pm.mutex); 1354 - return ret; 1355 - } 1356 1343 1357 1344 /* do the actual fw loading */ 1358 1345 ret = cz_smu_start(adev);