[AMD Official Use Only - General] Reviewed-and-tested-by: Evan Quan <evan.quan@xxxxxxx> > -----Original Message----- > From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Jack > Xiao > Sent: Monday, February 13, 2023 6:52 PM > To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx > Cc: Xiao, Jack <Jack.Xiao@xxxxxxx>; jfalempe@xxxxxxxxxx > Subject: [PATCH] drm/amd/amdgpu: fix warining during suspend > > Freeing memory was warned during suspend. > Move the self test out of suspend. > > Link: https://bugzilla.redhat.com/show_bug.cgi?id=2151825 > Cc: jfalempe@xxxxxxxxxx > Signed-off-by: Jack Xiao <Jack.Xiao@xxxxxxx> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ > drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 2 +- > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index a10b627c8357..3842e7e62eda 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -4270,6 +4270,9 @@ int amdgpu_device_resume(struct drm_device > *dev, bool fbcon) > } > adev->in_suspend = false; > > + if (adev->enable_mes) > + amdgpu_mes_self_test(adev); > + > if (amdgpu_acpi_smart_shift_update(dev, AMDGPU_SS_DEV_D0)) > DRM_WARN("smart shift update failed\n"); > > diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c > b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c > index 62cdd2113135..5826eac270d7 100644 > --- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c > @@ -1284,7 +1284,7 @@ static int mes_v11_0_late_init(void *handle) > struct amdgpu_device *adev = (struct amdgpu_device *)handle; > > /* it's only intended for use in mes_self_test case, not for s0ix and > reset */ > - if (!amdgpu_in_reset(adev) && !adev->in_s0ix && > + if (!amdgpu_in_reset(adev) && !adev->in_s0ix && !adev- > >in_suspend && > (adev->ip_versions[GC_HWIP][0] != IP_VERSION(11, 0, 3))) > amdgpu_mes_self_test(adev); > > -- > 2.37.3