All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix reset domain xgmi hive info reference leak
@ 2022-08-11 13:42 Jonathan Kim
  2022-08-11 15:18 ` Felix Kuehling
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Kim @ 2022-08-11 13:42 UTC (permalink / raw)
  To: amd-gfx; +Cc: Jonathan Kim

When an xgmi node is added to the hive, it takes another hive
reference for its reset domain.

This extra reference was not dropped on device removal from the
hive so drop it.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
index 1b108d03e785..560bf1c98f08 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
@@ -731,6 +731,9 @@ int amdgpu_xgmi_remove_device(struct amdgpu_device *adev)
 	mutex_unlock(&hive->hive_lock);
 
 	amdgpu_put_xgmi_hive(hive);
+	/* device is removed from the hive so remove its reset domain reference */
+	if (adev->reset_domain && adev->reset_domain == hive->reset_domain)
+		amdgpu_put_xgmi_hive(hive);
 	adev->hive = NULL;
 
 	if (atomic_dec_return(&hive->number_devices) == 0) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-08-12 22:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-11 13:42 [PATCH] drm/amdgpu: fix reset domain xgmi hive info reference leak Jonathan Kim
2022-08-11 15:18 ` Felix Kuehling
2022-08-11 15:34   ` Kim, Jonathan
2022-08-11 16:43     ` Andrey Grodzovsky
2022-08-12 18:38       ` Kim, Jonathan
2022-08-12 22:05         ` Andrey Grodzovsky
2022-08-12 22:11           ` Felix Kuehling
2022-08-12 22:28             ` Kim, Jonathan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.