Skip to content

Commit 7123d39

Browse files
superm1alexdeucher
authored andcommitted
drm/amd: Don't reset dGPUs if the system is going to s2idle
An A+A configuration on ASUS ROG Strix G513QY proves that the ASIC reset for handling aborted suspend can't work with s2idle. This functionality was introduced in commit daf8de0 ("drm/amdgpu: always reset the asic in suspend (v2)"). A few other commits have gone on top of the ASIC reset, but this still doesn't work on the A+A configuration in s2idle. Avoid doing the reset on dGPUs specifically when using s2idle. Fixes: daf8de0 ("drm/amdgpu: always reset the asic in suspend (v2)") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2008 Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent 42226c9 commit 7123d39

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,9 +1342,11 @@ static inline int amdgpu_acpi_smart_shift_update(struct drm_device *dev,
13421342

13431343
#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND)
13441344
bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev);
1345+
bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev);
13451346
bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
13461347
#else
13471348
static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
1349+
static inline bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev) { return false; }
13481350
static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false; }
13491351
#endif
13501352

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,20 @@ bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev)
10451045
(pm_suspend_target_state == PM_SUSPEND_MEM);
10461046
}
10471047

1048+
/**
1049+
* amdgpu_acpi_should_gpu_reset
1050+
*
1051+
* @adev: amdgpu_device_pointer
1052+
*
1053+
* returns true if should reset GPU, false if not
1054+
*/
1055+
bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev)
1056+
{
1057+
if (adev->flags & AMD_IS_APU)
1058+
return false;
1059+
return pm_suspend_target_state != PM_SUSPEND_TO_IDLE;
1060+
}
1061+
10481062
/**
10491063
* amdgpu_acpi_is_s0ix_active
10501064
*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2336,7 +2336,7 @@ static int amdgpu_pmops_suspend_noirq(struct device *dev)
23362336
struct drm_device *drm_dev = dev_get_drvdata(dev);
23372337
struct amdgpu_device *adev = drm_to_adev(drm_dev);
23382338

2339-
if (!adev->in_s0ix)
2339+
if (amdgpu_acpi_should_gpu_reset(adev))
23402340
return amdgpu_asic_reset(adev);
23412341

23422342
return 0;

0 commit comments

Comments
 (0)