[PATCH] amdgpu: Do not trigger reset_method S3 workaround for S4
Alex Deucher
alexdeucher at gmail.com
Tue Mar 25 13:55:30 UTC 2025
On Tue, Mar 25, 2025 at 4:33 AM Harald Judt <h.judt at gmx.at> wrote:
>
> From 9a2f16a4a43f424f5008d5c4a87e1329f682e919 Mon Sep 17 00:00:00 2001
> From: Harald Judt <h.judt at gmx.at>
> Date: Sat, 22 Mar 2025 23:01:57 +0100
> Subject: [PATCH] amdgpu: Do not trigger reset_method S3 workaround for S4
>
> Commit 3a9626c816db ("drm/amd: Stop evicting resources on APUs in suspend")
> causes hibernation to fail on R390 because it triggers a workaround for S3 in
> amdgpu_dpm_is_baco_supported that disables BACO. With reset_method PCI CONFIG,
> S3 works but S4 fails on resume. This commit fixes this by modifying the
> workaround to only apply for S3 and not S4.
>
> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3634
Please use git-send-email to send out patches. Your email client has
messed up the formatting. Also, I think this issue may already be
fixed by this patch:
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4afacc9948e1f8fdbca401d259ae65ad93d298c0
Alex
> Signed-off-by: Harald Judt <h.judt at gmx.at>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 10 ++++++----
> drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 2 +-
> 2 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 91a874bb0e24..05ac13f1aa6a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -2556,13 +2556,15 @@ static int amdgpu_pmops_freeze(struct device *dev)
>
> adev->in_s4 = true;
> r = amdgpu_device_suspend(drm_dev, true);
> - adev->in_s4 = false;
> if (r)
> - return r;
> + goto out;
>
> if (amdgpu_acpi_should_gpu_reset(adev))
> - return amdgpu_asic_reset(adev);
> - return 0;
> + r = amdgpu_asic_reset(adev);
> +
> +out:
> + adev->in_s4 = false;
> + return r;
> }
>
> static int amdgpu_pmops_thaw(struct device *dev)
> diff --git a/drivers/gpu/drm/amd/pm/amdgpu_dpm.c
> b/drivers/gpu/drm/amd/pm/amdgpu_dpm.c
> index 9dc82f4d7c93..1a8624b2f388 100644
> --- a/drivers/gpu/drm/amd/pm/amdgpu_dpm.c
> +++ b/drivers/gpu/drm/amd/pm/amdgpu_dpm.c
> @@ -220,7 +220,7 @@ int amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev)
> * Powering down/up everything may adversely affect these other
> * devices. Needs more investigation.
> */
> - if (adev->in_s3)
> + if (adev->in_s3 && !adev->in_s4)
> return 0;
>
> mutex_lock(&adev->pm.mutex);
> --
> 2.49.0
>
>
> --
> `Experience is the best teacher.'
>
> PGP Key ID: 4FFFAB21B8580ABD
> Fingerprint: E073 6DD8 FF40 9CF2 0665 11D4 4FFF AB21 B858 0ABD
>
More information about the amd-gfx
mailing list