FAILED: patch "[PATCH] drm/amdgpu: Reset dGPU if suspend got aborted" failed to apply to 6.6-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x df3c7dc5c58b1f85033d2cd9a121b27844700ca2
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2024061932-pox-humid-9244@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
df3c7dc5c58b ("drm/amdgpu: Reset dGPU if suspend got aborted")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From df3c7dc5c58b1f85033d2cd9a121b27844700ca2 Mon Sep 17 00:00:00 2001
From: Lijo Lazar <[email protected]>
Date: Wed, 14 Feb 2024 17:55:54 +0530
Subject: [PATCH] drm/amdgpu: Reset dGPU if suspend got aborted
For SOC21 ASICs, there is an issue in re-enabling PM features if a suspend got aborted. In such cases, reset the device during resume phase. This is a workaround till a proper solution is finalized.
drivers/gpu/drm/amd/amdgpu/soc21.c +25 -0
@@ -867,10 +867,35 @@ static int soc21_common_suspend(void *handle)return soc21_common_hw_fini (adev); } +static bool soc21_need_reset_on_resume (struct amdgpu_device *adev) +{ +u32 sol_reg1, sol_reg2; + +/* Will reset for the following suspend abort cases. +* 1) Only reset dGPU side. +* 2) S3 suspend got aborted and TOS is active. +*/ +if (!(adev->flags &AMD_IS_APU ) && adev->in_s3 && + !adev->suspend_complete) { + sol_reg1 =RREG32_SOC15 (MP0 ,0 , regMP0_SMN_C2PMSG_81); +msleep (100 ); + sol_reg2 =RREG32_SOC15 (MP0 ,0 , regMP0_SMN_C2PMSG_81); + +return (sol_reg1 != sol_reg2); + } + +return false; +} +static int soc21_common_resume (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +if (soc21_need_reset_on_resume (adev)) { +dev_info (adev->dev,"S3 suspend aborted, resetting..." ); +soc21_asic_reset (adev); + } +return soc21_common_hw_init (adev); }