All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Kim <jonathan.kim@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Jonathan Kim <jonathan.kim@amd.com>
Subject: [PATCH] drm/amdgpu: fix reset domain xgmi hive info reference leak
Date: Thu, 11 Aug 2022 09:42:17 -0400	[thread overview]
Message-ID: <20220811134217.138701-1-jonathan.kim@amd.com> (raw)

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


             reply	other threads:[~2022-08-11 13:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 13:42 Jonathan Kim [this message]
2022-08-11 15:18 ` [PATCH] drm/amdgpu: fix reset domain xgmi hive info reference leak 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220811134217.138701-1-jonathan.kim@amd.com \
    --to=jonathan.kim@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.