@@ -3172,7 +3172,7 @@ static int amdgpu_device_ip_resume_phase1(struct amdgpu_device *adev)
3172
3172
*
3173
3173
* @adev: amdgpu_device pointer
3174
3174
*
3175
- * First resume function for hardware IPs. The list of all the hardware
3175
+ * Second resume function for hardware IPs. The list of all the hardware
3176
3176
* IPs that make up the asic is walked and the resume callbacks are run for
3177
3177
* all blocks except COMMON, GMC, and IH. resume puts the hardware into a
3178
3178
* functional state after a suspend and updates the software state as
@@ -3190,6 +3190,7 @@ static int amdgpu_device_ip_resume_phase2(struct amdgpu_device *adev)
3190
3190
if (adev -> ip_blocks [i ].version -> type == AMD_IP_BLOCK_TYPE_COMMON ||
3191
3191
adev -> ip_blocks [i ].version -> type == AMD_IP_BLOCK_TYPE_GMC ||
3192
3192
adev -> ip_blocks [i ].version -> type == AMD_IP_BLOCK_TYPE_IH ||
3193
+ adev -> ip_blocks [i ].version -> type == AMD_IP_BLOCK_TYPE_DCE ||
3193
3194
adev -> ip_blocks [i ].version -> type == AMD_IP_BLOCK_TYPE_PSP )
3194
3195
continue ;
3195
3196
r = adev -> ip_blocks [i ].version -> funcs -> resume (adev );
@@ -3204,6 +3205,36 @@ static int amdgpu_device_ip_resume_phase2(struct amdgpu_device *adev)
3204
3205
return 0 ;
3205
3206
}
3206
3207
3208
+ /**
3209
+ * amdgpu_device_ip_resume_phase3 - run resume for hardware IPs
3210
+ *
3211
+ * @adev: amdgpu_device pointer
3212
+ *
3213
+ * Third resume function for hardware IPs. The list of all the hardware
3214
+ * IPs that make up the asic is walked and the resume callbacks are run for
3215
+ * all DCE. resume puts the hardware into a functional state after a suspend
3216
+ * and updates the software state as necessary. This function is also used
3217
+ * for restoring the GPU after a GPU reset.
3218
+ *
3219
+ * Returns 0 on success, negative error code on failure.
3220
+ */
3221
+ static int amdgpu_device_ip_resume_phase3 (struct amdgpu_device * adev )
3222
+ {
3223
+ int i , r ;
3224
+
3225
+ for (i = 0 ; i < adev -> num_ip_blocks ; i ++ ) {
3226
+ if (!adev -> ip_blocks [i ].status .valid || adev -> ip_blocks [i ].status .hw )
3227
+ continue ;
3228
+ if (adev -> ip_blocks [i ].version -> type == AMD_IP_BLOCK_TYPE_DCE ) {
3229
+ r = adev -> ip_blocks [i ].version -> funcs -> resume (adev );
3230
+ if (r )
3231
+ return r ;
3232
+ }
3233
+ }
3234
+
3235
+ return 0 ;
3236
+ }
3237
+
3207
3238
/**
3208
3239
* amdgpu_device_ip_resume - run resume for hardware IPs
3209
3240
*
@@ -3230,6 +3261,13 @@ static int amdgpu_device_ip_resume(struct amdgpu_device *adev)
3230
3261
3231
3262
r = amdgpu_device_ip_resume_phase2 (adev );
3232
3263
3264
+ if (r )
3265
+ return r ;
3266
+
3267
+ amdgpu_fence_driver_hw_init (adev );
3268
+
3269
+ r = amdgpu_device_ip_resume_phase3 (adev );
3270
+
3233
3271
return r ;
3234
3272
}
3235
3273
@@ -4229,7 +4267,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
4229
4267
dev_err (adev -> dev , "amdgpu_device_ip_resume failed (%d).\n" , r );
4230
4268
goto exit ;
4231
4269
}
4232
- amdgpu_fence_driver_hw_init (adev );
4233
4270
4234
4271
r = amdgpu_device_ip_late_init (adev );
4235
4272
if (r )
@@ -4999,6 +5036,10 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,
4999
5036
if (r )
5000
5037
goto out ;
5001
5038
5039
+ r = amdgpu_device_ip_resume_phase3 (tmp_adev );
5040
+ if (r )
5041
+ goto out ;
5042
+
5002
5043
if (vram_lost )
5003
5044
amdgpu_device_fill_reset_magic (tmp_adev );
5004
5045
0 commit comments