From: Greg Kroah-Hartman Date: Wed, 31 May 2023 18:18:05 +0000 (+0100) Subject: 6.1-stable patches X-Git-Tag: v5.4.245~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=970e08eb9f971ca9274765d5f760212472afa5a5;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: drm-amd-don-t-allow-s0ix-on-apus-older-than-raven.patch --- diff --git a/queue-6.1/drm-amd-don-t-allow-s0ix-on-apus-older-than-raven.patch b/queue-6.1/drm-amd-don-t-allow-s0ix-on-apus-older-than-raven.patch new file mode 100644 index 00000000000..87128dad6e4 --- /dev/null +++ b/queue-6.1/drm-amd-don-t-allow-s0ix-on-apus-older-than-raven.patch @@ -0,0 +1,64 @@ +From ca47518663973083c513cd6b2801dcda0bfaaa99 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Mon, 13 Feb 2023 15:10:30 -0600 +Subject: drm/amd: Don't allow s0ix on APUs older than Raven + +From: Mario Limonciello + +commit ca47518663973083c513cd6b2801dcda0bfaaa99 upstream. + +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: cf488dcd0ab7 ("drm/amd: Allow s0ix without BIOS support") +Suggested-by: Alexander Deucher +Signed-off-by: Mario Limonciello +Reviewed-by: Alex Deucher +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 3 +++ + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 7 ++++++- + 2 files changed, 9 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +@@ -1083,6 +1083,9 @@ bool amdgpu_acpi_is_s0ix_active(struct a + (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 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +@@ -2402,8 +2402,10 @@ static int amdgpu_pmops_suspend(struct d + + 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); + } + +@@ -2424,6 +2426,9 @@ static int amdgpu_pmops_resume(struct de + 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; diff --git a/queue-6.1/series b/queue-6.1/series index 036e4c565b4..66fe493a61e 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -32,3 +32,4 @@ dmaengine-at_xdmac-disable-enable-clock-directly-on-.patch dmaengine-at_xdmac-do-not-resume-channels-paused-by-.patch dmaengine-at_xdmac-restore-the-content-of-grws-regis.patch octeontx2-af-add-validation-for-lmac-type.patch +drm-amd-don-t-allow-s0ix-on-apus-older-than-raven.patch