Skip to content

Commit ca47518

Browse files
superm1alexdeucher
authored andcommitted
drm/amd: Don't allow s0ix on APUs older than Raven
APUs before Raven didn't support s0ix. As we just relieved some of the safety checks for s0ix to improve power consumption on APUs that support it but that are missing BIOS support a new blind spot was introduced that a user could "try" to run s0ix. Plug this hole so that if users try to run s0ix on anything older than Raven it will just skip suspend of the GPU. Fixes: cf488dc ("drm/amd: Allow s0ix without BIOS support") Suggested-by: Alexander Deucher <Alexander.Deucher@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent f9c35f4 commit ca47518

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,9 @@ bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
10731073
(pm_suspend_target_state != PM_SUSPEND_TO_IDLE))
10741074
return false;
10751075

1076+
if (adev->asic_type < CHIP_RAVEN)
1077+
return false;
1078+
10761079
/*
10771080
* If ACPI_FADT_LOW_POWER_S0 is not set in the FADT, it is generally
10781081
* risky to do any special firmware-related preparations for entering

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2414,8 +2414,10 @@ static int amdgpu_pmops_suspend(struct device *dev)
24142414

24152415
if (amdgpu_acpi_is_s0ix_active(adev))
24162416
adev->in_s0ix = true;
2417-
else
2417+
else if (amdgpu_acpi_is_s3_active(adev))
24182418
adev->in_s3 = true;
2419+
if (!adev->in_s0ix && !adev->in_s3)
2420+
return 0;
24192421
return amdgpu_device_suspend(drm_dev, true);
24202422
}
24212423

@@ -2436,6 +2438,9 @@ static int amdgpu_pmops_resume(struct device *dev)
24362438
struct amdgpu_device *adev = drm_to_adev(drm_dev);
24372439
int r;
24382440

2441+
if (!adev->in_s0ix && !adev->in_s3)
2442+
return 0;
2443+
24392444
/* Avoids registers access if device is physically gone */
24402445
if (!pci_device_is_present(adev->pdev))
24412446
adev->no_hw_access = true;

0 commit comments

Comments
 (0)