@@ -574,11 +574,34 @@ soc15_asic_reset_method(struct amdgpu_device *adev)
574574 return AMD_RESET_METHOD_MODE1 ;
575575}
576576
577+ static bool soc15_need_reset_on_resume (struct amdgpu_device * adev )
578+ {
579+ u32 sol_reg ;
580+
581+ sol_reg = RREG32_SOC15 (MP0 , 0 , mmMP0_SMN_C2PMSG_81 );
582+
583+ /* Will reset for the following suspend abort cases.
584+ * 1) Only reset limit on APU side, dGPU hasn't checked yet.
585+ * 2) S3 suspend abort and TOS already launched.
586+ */
587+ if (adev -> flags & AMD_IS_APU && adev -> in_s3 &&
588+ !adev -> suspend_complete &&
589+ sol_reg )
590+ return true;
591+
592+ return false;
593+ }
594+
577595static int soc15_asic_reset (struct amdgpu_device * adev )
578596{
579597 /* original raven doesn't have full asic reset */
580- if ((adev -> apu_flags & AMD_APU_IS_RAVEN ) ||
581- (adev -> apu_flags & AMD_APU_IS_RAVEN2 ))
598+ /* On the latest Raven, the GPU reset can be performed
599+ * successfully. So now, temporarily enable it for the
600+ * S3 suspend abort case.
601+ */
602+ if (((adev -> apu_flags & AMD_APU_IS_RAVEN ) ||
603+ (adev -> apu_flags & AMD_APU_IS_RAVEN2 )) &&
604+ !soc15_need_reset_on_resume (adev ))
582605 return 0 ;
583606
584607 switch (soc15_asic_reset_method (adev )) {
@@ -1298,24 +1321,6 @@ static int soc15_common_suspend(void *handle)
12981321 return soc15_common_hw_fini (adev );
12991322}
13001323
1301- static bool soc15_need_reset_on_resume (struct amdgpu_device * adev )
1302- {
1303- u32 sol_reg ;
1304-
1305- sol_reg = RREG32_SOC15 (MP0 , 0 , mmMP0_SMN_C2PMSG_81 );
1306-
1307- /* Will reset for the following suspend abort cases.
1308- * 1) Only reset limit on APU side, dGPU hasn't checked yet.
1309- * 2) S3 suspend abort and TOS already launched.
1310- */
1311- if (adev -> flags & AMD_IS_APU && adev -> in_s3 &&
1312- !adev -> suspend_complete &&
1313- sol_reg )
1314- return true;
1315-
1316- return false;
1317- }
1318-
13191324static int soc15_common_resume (void * handle )
13201325{
13211326 struct amdgpu_device * adev = (struct amdgpu_device * )handle ;
0 commit comments