Skip to content

Commit d5e3d8a

Browse files
Prike Liangalexdeucher
Prike Liang
authored andcommitted
drm/amdgpu: clean up the suspend_complete
To check the status of S3 suspend completion, use the PM core pm_suspend_global_flags bit(1) to detect S3 abort events. Therefore, clean up the AMDGPU driver's private flag suspend_complete. Signed-off-by: Prike Liang <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 58a8c75 commit d5e3d8a

File tree

5 files changed

+7
-13
lines changed

5 files changed

+7
-13
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu.h

-2
Original file line numberDiff line numberDiff line change
@@ -1111,8 +1111,6 @@ struct amdgpu_device {
11111111
bool in_s3;
11121112
bool in_s4;
11131113
bool in_s0ix;
1114-
/* indicate amdgpu suspension status */
1115-
bool suspend_complete;
11161114

11171115
enum pp_mp1_state mp1_state;
11181116
struct amdgpu_doorbell_index doorbell_index;

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

-2
Original file line numberDiff line numberDiff line change
@@ -2500,7 +2500,6 @@ static int amdgpu_pmops_suspend(struct device *dev)
25002500
struct drm_device *drm_dev = dev_get_drvdata(dev);
25012501
struct amdgpu_device *adev = drm_to_adev(drm_dev);
25022502

2503-
adev->suspend_complete = false;
25042503
if (amdgpu_acpi_is_s0ix_active(adev))
25052504
adev->in_s0ix = true;
25062505
else if (amdgpu_acpi_is_s3_active(adev))
@@ -2515,7 +2514,6 @@ static int amdgpu_pmops_suspend_noirq(struct device *dev)
25152514
struct drm_device *drm_dev = dev_get_drvdata(dev);
25162515
struct amdgpu_device *adev = drm_to_adev(drm_dev);
25172516

2518-
adev->suspend_complete = true;
25192517
if (amdgpu_acpi_should_gpu_reset(adev))
25202518
return amdgpu_asic_reset(adev);
25212519

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -3288,8 +3288,8 @@ static int gfx_v9_0_cp_gfx_start(struct amdgpu_device *adev)
32883288
* confirmed that the APU gfx10/gfx11 needn't such update.
32893289
*/
32903290
if (adev->flags & AMD_IS_APU &&
3291-
adev->in_s3 && !adev->suspend_complete) {
3292-
DRM_INFO(" Will skip the CSB packet resubmit\n");
3291+
adev->in_s3 && !pm_resume_via_firmware()) {
3292+
DRM_INFO("Will skip the CSB packet resubmit\n");
32933293
return 0;
32943294
}
32953295
r = amdgpu_ring_alloc(ring, gfx_v9_0_get_csb_size(adev) + 4 + 3);

drivers/gpu/drm/amd/amdgpu/soc15.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -584,13 +584,10 @@ static bool soc15_need_reset_on_resume(struct amdgpu_device *adev)
584584
* performing pm core test.
585585
*/
586586
if (adev->flags & AMD_IS_APU && adev->in_s3 &&
587-
!pm_resume_via_firmware()) {
588-
adev->suspend_complete = false;
587+
!pm_resume_via_firmware())
589588
return true;
590-
} else {
591-
adev->suspend_complete = true;
589+
else
592590
return false;
593-
}
594591
}
595592

596593
static int soc15_asic_reset(struct amdgpu_device *adev)

drivers/gpu/drm/amd/amdgpu/soc21.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -897,9 +897,10 @@ static bool soc21_need_reset_on_resume(struct amdgpu_device *adev)
897897
/* Will reset for the following suspend abort cases.
898898
* 1) Only reset dGPU side.
899899
* 2) S3 suspend got aborted and TOS is active.
900+
* As for dGPU suspend abort cases the SOL value
901+
* will be kept as zero at this resume point.
900902
*/
901-
if (!(adev->flags & AMD_IS_APU) && adev->in_s3 &&
902-
!adev->suspend_complete) {
903+
if (!(adev->flags & AMD_IS_APU) && adev->in_s3) {
903904
sol_reg1 = RREG32_SOC15(MP0, 0, regMP0_SMN_C2PMSG_81);
904905
msleep(100);
905906
sol_reg2 = RREG32_SOC15(MP0, 0, regMP0_SMN_C2PMSG_81);

0 commit comments

Comments
 (0)