All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mario Limonciello (AMD)" <superm1@kernel.org>
To: amd-gfx@lists.freedesktop.org
Cc: "Mario Limonciello (AMD)" <superm1@kernel.org>
Subject: [PATCH v2 2/3] amdkfd: Don't rebuild node tree when calling kfd_topology_update_sysfs()
Date: Wed, 10 Dec 2025 14:15:09 -0600	[thread overview]
Message-ID: <20251210201510.3000-3-superm1@kernel.org> (raw)
In-Reply-To: <20251210201510.3000-1-superm1@kernel.org>

There is no need to remove all the nodes and rebuild them.  The content
will be the same.  Instead check whether the node was created and skip
the creation.

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index a0990dd2378c1..b65f29294e2d6 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -650,8 +650,8 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev,
 	uint32_t i, num_attrs;
 	struct attribute **attrs;
 
-	if (WARN_ON(dev->kobj_node))
-		return -EEXIST;
+	if (dev->kobj_node)
+		return 0;
 
 	/*
 	 * Creating the sysfs folders
@@ -888,8 +888,6 @@ static int kfd_topology_update_sysfs(void)
 			return ret;
 	}
 
-	kfd_remove_sysfs_node_tree();
-
 	return kfd_build_sysfs_node_tree();
 }
 
-- 
2.43.0


  parent reply	other threads:[~2025-12-10 20:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-10 20:15 [PATCH v2 0/3] Make device links between KFD and GPU device Mario Limonciello (AMD)
2025-12-10 20:15 ` [PATCH v2 1/3] amdkfd: Only ignore -ENOENT for KFD init failuires Mario Limonciello (AMD)
2025-12-10 20:15 ` Mario Limonciello (AMD) [this message]
2025-12-10 20:40   ` [PATCH v2 2/3] amdkfd: Don't rebuild node tree when calling kfd_topology_update_sysfs() Russell, Kent
2025-12-16  2:42   ` Kasiviswanathan, Harish
2025-12-10 20:15 ` [PATCH v2 3/3] amdkfd: Add device links between kfd device and amdgpu device Mario Limonciello (AMD)
2025-12-10 20:40   ` Russell, Kent
2025-12-16  2:45   ` Kasiviswanathan, Harish
2025-12-16 12:20     ` Mario Limonciello

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=20251210201510.3000-3-superm1@kernel.org \
    --to=superm1@kernel.org \
    --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.