@@ -3242,7 +3242,7 @@ static int amdgpu_device_ip_resume_phase1(struct amdgpu_device *adev)
3242
3242
*
3243
3243
* @adev: amdgpu_device pointer
3244
3244
*
3245
- * First resume function for hardware IPs. The list of all the hardware
3245
+ * Second resume function for hardware IPs. The list of all the hardware
3246
3246
* IPs that make up the asic is walked and the resume callbacks are run for
3247
3247
* all blocks except COMMON, GMC, and IH. resume puts the hardware into a
3248
3248
* functional state after a suspend and updates the software state as
@@ -3260,6 +3260,7 @@ static int amdgpu_device_ip_resume_phase2(struct amdgpu_device *adev)
3260
3260
if (adev -> ip_blocks [i ].version -> type == AMD_IP_BLOCK_TYPE_COMMON ||
3261
3261
adev -> ip_blocks [i ].version -> type == AMD_IP_BLOCK_TYPE_GMC ||
3262
3262
adev -> ip_blocks [i ].version -> type == AMD_IP_BLOCK_TYPE_IH ||
3263
+ adev -> ip_blocks [i ].version -> type == AMD_IP_BLOCK_TYPE_DCE ||
3263
3264
adev -> ip_blocks [i ].version -> type == AMD_IP_BLOCK_TYPE_PSP )
3264
3265
continue ;
3265
3266
r = adev -> ip_blocks [i ].version -> funcs -> resume (adev );
@@ -3283,6 +3284,36 @@ static int amdgpu_device_ip_resume_phase2(struct amdgpu_device *adev)
3283
3284
return 0 ;
3284
3285
}
3285
3286
3287
+ /**
3288
+ * amdgpu_device_ip_resume_phase3 - run resume for hardware IPs
3289
+ *
3290
+ * @adev: amdgpu_device pointer
3291
+ *
3292
+ * Third resume function for hardware IPs. The list of all the hardware
3293
+ * IPs that make up the asic is walked and the resume callbacks are run for
3294
+ * all DCE. resume puts the hardware into a functional state after a suspend
3295
+ * and updates the software state as necessary. This function is also used
3296
+ * for restoring the GPU after a GPU reset.
3297
+ *
3298
+ * Returns 0 on success, negative error code on failure.
3299
+ */
3300
+ static int amdgpu_device_ip_resume_phase3 (struct amdgpu_device * adev )
3301
+ {
3302
+ int i , r ;
3303
+
3304
+ for (i = 0 ; i < adev -> num_ip_blocks ; i ++ ) {
3305
+ if (!adev -> ip_blocks [i ].status .valid || adev -> ip_blocks [i ].status .hw )
3306
+ continue ;
3307
+ if (adev -> ip_blocks [i ].version -> type == AMD_IP_BLOCK_TYPE_DCE ) {
3308
+ r = adev -> ip_blocks [i ].version -> funcs -> resume (adev );
3309
+ if (r )
3310
+ return r ;
3311
+ }
3312
+ }
3313
+
3314
+ return 0 ;
3315
+ }
3316
+
3286
3317
/**
3287
3318
* amdgpu_device_ip_resume - run resume for hardware IPs
3288
3319
*
@@ -3313,6 +3344,13 @@ static int amdgpu_device_ip_resume(struct amdgpu_device *adev)
3313
3344
3314
3345
r = amdgpu_device_ip_resume_phase2 (adev );
3315
3346
3347
+ if (r )
3348
+ return r ;
3349
+
3350
+ amdgpu_fence_driver_hw_init (adev );
3351
+
3352
+ r = amdgpu_device_ip_resume_phase3 (adev );
3353
+
3316
3354
return r ;
3317
3355
}
3318
3356
@@ -4311,7 +4349,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
4311
4349
dev_err (adev -> dev , "amdgpu_device_ip_resume failed (%d).\n" , r );
4312
4350
return r ;
4313
4351
}
4314
- amdgpu_fence_driver_hw_init (adev );
4315
4352
4316
4353
r = amdgpu_device_ip_late_init (adev );
4317
4354
if (r )
@@ -5065,6 +5102,10 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,
5065
5102
if (r )
5066
5103
goto out ;
5067
5104
5105
+ r = amdgpu_device_ip_resume_phase3 (tmp_adev );
5106
+ if (r )
5107
+ goto out ;
5108
+
5068
5109
if (vram_lost )
5069
5110
amdgpu_device_fill_reset_magic (tmp_adev );
5070
5111
0 commit comments