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) <[email protected]>
---
 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

Reply via email to