Skip to contentSkip to conversation

drm/amd/amdgpu: fix warining during suspend

PATCH In review Jack Xiao 5 participants 5 messages Feb 13, 2023 – Feb 14, 2023

Subsystems (2)
lore
Share & tools
lore

Jack Xiao

author
#0 lore raw

PATCH 1/1 drm/amd/amdgpu: fix warining during suspend

Freeing memory was warned during suspend.
Move the self test out of suspend.

---
 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(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
index a10b627c8357..3842e7e62eda 100644
@@ -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");
 
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +1 -1
index 62cdd2113135..5826eac270d7 100644
@@ -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);
 
Signature · 1 line
2.37.3
Reviewed-by on v1 1/1
#1 lore raw

Am 13.02.23 um 11:52 schrieb Jack Xiao:

Quoted 6 lines

Freeing memory was warned during suspend.
Move the self test out of suspend.

Quoted 32 lines
---
  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(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
index a10b627c8357..3842e7e62eda 100644
@@ -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");
 
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +1 -1
index 62cdd2113135..5826eac270d7 100644
@@ -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);
 
Reviewed-by on v1 1/1
#2 lore raw
In reply to Jack Xiao

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Jack Xiao
Sent: Monday, February 13, 2023 6:52 PM
To: [email protected]
Cc: Xiao, Jack <[email protected]>; [email protected]
Subject: [PATCH] drm/amd/amdgpu: fix warining during suspend

Freeing memory was warned during suspend.
Move the self test out of suspend.

---
 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(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
index a10b627c8357..3842e7e62eda 100644
@@ -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");
 
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +1 -1
index 62cdd2113135..5826eac270d7 100644
@@ -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);
 
Signature · 1 line
2.37.3
#3 lore raw
In reply to Jack Xiao

[AMD Official Use Only - General]

Reviewed-and-tested-by Evan Quan <[email protected]>
Quoted 53 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Jack Xiao
Sent: Monday, February 13, 2023 6:52 PM
To: [email protected]
Cc: Xiao, Jack <[email protected]>; [email protected]
Subject: [PATCH] drm/amd/amdgpu: fix warining during suspend

Freeing memory was warned during suspend.
Move the self test out of suspend.

---
 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(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
index a10b627c8357..3842e7e62eda 100644
@@ -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");
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +0 -0
index 62cdd2113135..5826eac270d7 100644
@@ -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 */

drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +1 -1
-	if (!amdgpu_in_reset(adev) && !adev->in_s0ix &&
+	if (!amdgpu_in_reset(adev) && !adev->in_s0ix && !adev-
Quoted 1 line

in_suspend &&

drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +0 -1
 	    (adev->ip_versions[GC_HWIP][0] != IP_VERSION(11, 0, 3)))
 		amdgpu_mes_self_test(adev);
 
--

2.37.3

Tested-by on v1 1/1
#4 lore raw
In reply to Jack Xiao
Quoted 2 lines · Jack Xiao

Freeing memory was warned during suspend.
Move the self test out of suspend.

Thanks a lot, this fixes the following warning during suspend/resume on v6.2-rc8

WARNING: CPU: 2 PID: 3980 at drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:425 amdgpu_bo_free_kernel+0xf5/0x110 [amdgpu]
Signature · 1 line
Jocelyn