On Mon, Jun 16, 2025 at 1:50 PM Mario Limonciello <[email protected]> wrote: > > From: Mario Limonciello <[email protected]> > > Normally resources are evicted on dGPUs at suspend or hibernate and > on APUs at hibernate. These steps are unnecessary when using the S4 > callbacks to put the system into S5. > > Cc: AceLan Kao <[email protected]> > Cc: Kai-Heng Feng <[email protected]> > Cc: Mark Pearson <[email protected]> > Cc: Denis Benato <[email protected]> > Cc: Merthan Karakaş <[email protected]> > Signed-off-by: Mario Limonciello <[email protected]>
Acked-by: Alex Deucher <[email protected]> > --- > v3: > https://lore.kernel.org/linux-pm/[email protected]/T/#me6db0fb946e3d604a8f3d455128844ed802c82bb > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index 8edd88328749b..c5d8f6d551238 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -4966,6 +4966,10 @@ static int amdgpu_device_evict_resources(struct > amdgpu_device *adev) > if (!adev->in_s4 && (adev->flags & AMD_IS_APU)) > return 0; > > + /* No need to evict when going to S5 through S4 callbacks */ > + if (system_state == SYSTEM_HALT || system_state == SYSTEM_POWER_OFF) > + return 0; > + > ret = amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM); > if (ret) > DRM_WARN("evicting device resources failed\n"); > -- > 2.43.0 >
