drm/amdgpu: don't set s3 and s0ix at the same time
authorjsg <jsg@openbsd.org>
Fri, 13 May 2022 03:28:25 +0000 (03:28 +0000)
committerjsg <jsg@openbsd.org>
Fri, 13 May 2022 03:28:25 +0000 (03:28 +0000)
From Mario Limonciello
060102fbd92d2d514c4a4da71d555cf9b7d65faa in linux 5.15.y/5.15.39
eac4c54bf7f17fb4681b85e5fe383b74d6261a2b in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c

index 9d7f33d..ecb90e0 100644 (file)
@@ -2254,9 +2254,9 @@ static int amdgpu_pmops_suspend(struct device *dev)
 
        if (amdgpu_acpi_is_s0ix_active(adev))
                adev->in_s0ix = true;
-       adev->in_s3 = true;
+       else
+               adev->in_s3 = true;
        r = amdgpu_device_suspend(drm_dev, true);
-       adev->in_s3 = false;
        if (r)
                return r;
        if (!adev->in_s0ix)
@@ -2273,6 +2273,8 @@ static int amdgpu_pmops_resume(struct device *dev)
        r = amdgpu_device_resume(drm_dev, true);
        if (amdgpu_acpi_is_s0ix_active(adev))
                adev->in_s0ix = false;
+       else
+               adev->in_s3 = false;
        return r;
 }