From 24943abfc62948902d27df9ca79ed1965caa5ee3 Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 24 Feb 2022 12:45:37 +0000 Subject: [PATCH] drm/amd: Only run s3 or s0ix if system is configured properly From Mario Limonciello 38108fd273acbc6248870a7a3e61714398af6f94 in linux 5.15.y/5.15.25 04ef860469fda6a646dc841190d05b31fae68e8c in mainline linux --- sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c index 8511b6528dc..0914e142eb9 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c @@ -1503,6 +1503,7 @@ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work) static int amdgpu_pmops_prepare(struct device *dev) { struct drm_device *drm_dev = dev_get_drvdata(dev); + struct amdgpu_device *adev = drm_to_adev(drm_dev); /* Return a positive number here so * DPM_FLAG_SMART_SUSPEND works properly @@ -1510,6 +1511,13 @@ static int amdgpu_pmops_prepare(struct device *dev) if (amdgpu_device_supports_boco(drm_dev)) return pm_runtime_suspended(dev); + /* if we will not support s3 or s2i for the device + * then skip suspend + */ + if (!amdgpu_acpi_is_s0ix_active(adev) && + !amdgpu_acpi_is_s3_active(adev)) + return 1; + return 0; } -- 2.20.1