diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2023-06-16 01:31:35 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2023-06-16 01:31:35 +0000 |
commit | 3446db575d9385b11228d5ab3b58734800c854de (patch) | |
tree | 18ba9bbe16d26f84deed2ed892ab5185ca8ad607 | |
parent | f868589e70bc358c34c3116293295249ca3ea60b (diff) |
drm/amd: Don't allow s0ix on APUs older than Raven
From Mario Limonciello
6c1fad655b40b0de6ddad30d9c57e61046df262c in linux-6.1.y/6.1.32
ca47518663973083c513cd6b2801dcda0bfaaa99 in mainline linux
-rw-r--r-- | sys/dev/pci/drm/amd/amdgpu/amdgpu_acpi.c | 3 | ||||
-rw-r--r-- | sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_acpi.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_acpi.c index 31fc24dee53..cddd11bcf9b 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_acpi.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_acpi.c @@ -1096,6 +1096,9 @@ bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) (pm_suspend_target_state != PM_SUSPEND_TO_IDLE)) return false; + if (adev->asic_type < CHIP_RAVEN) + return false; + /* * If ACPI_FADT_LOW_POWER_S0 is not set in the FADT, it is generally * risky to do any special firmware-related preparations for entering diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c index d54444f921e..ec52c815dc3 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c @@ -2409,8 +2409,10 @@ static int amdgpu_pmops_suspend(struct device *dev) if (amdgpu_acpi_is_s0ix_active(adev)) adev->in_s0ix = true; - else + else if (amdgpu_acpi_is_s3_active(adev)) adev->in_s3 = true; + if (!adev->in_s0ix && !adev->in_s3) + return 0; return amdgpu_device_suspend(drm_dev, true); } @@ -2431,6 +2433,9 @@ static int amdgpu_pmops_resume(struct device *dev) struct amdgpu_device *adev = drm_to_adev(drm_dev); int r; + if (!adev->in_s0ix && !adev->in_s3) + return 0; + /* Avoids registers access if device is physically gone */ if (!pci_device_is_present(adev->pdev)) adev->no_hw_access = true; |