Skip to contentSkip to conversation

drm/amdgpu: Ensure that harvest information gets set

PATCH In review Kent Russell 3 participants 5 messages Oct 22 – Oct 27

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Ensure that harvest information gets set

After the earlier patch export IP discovery on probe failure, there was an unexpected consequence where harvest info was not populated. The early-exit in amdgpu_discovery_sysfs_init meant that we never called amdgpu_discovery_get_harvest_info, which is where we set the actual harvest value. The first time we call amdgpu_discovery_sysfs_recurse with NULL instead of adev, most values can get set. The 2nd time amdgpu_discovery_sysfs_recurse is called, we bail early.

To keep the logic of the first patch intact, ensuring that older kernels can still discover the IP blocks, add a separate call in the early-exit section that sets the harvest information. This should be the only functionality that is missed in this flow, the rest of the calls either work fine with adev=NULL, or use the discovery_bin directly.

Fixes 3ee1065e9830 ("drm/amdgpu: Export ip_discovery sysfs on probe failure")
Assisted-by Claude:claude-opus-4
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 45 +++++++++++++++++--
 1 file changed, 41 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +41 -4
index 16e3129db6a1..342edbd02880 100644
@@ -1469,6 +1469,41 @@ static int amdgpu_discovery_sysfs_recurse(struct amdgpu_device *adev,
 	return 0;
 }
 
+#define list_to_kobj(el) container_of(el, struct kobject, entry)
+
+static void amdgpu_discovery_sysfs_update_harvest(struct amdgpu_device *adev)
+{
+	struct ip_discovery_top *ip_top = adev->discovery.ip_top;
+	struct ip_die_entry *ip_die_entry;
+	struct list_head *el_die, *el_hw_id, *el_hw_inst;
+	struct ip_hw_id *hw_id;
+	struct kset *die_kset;
+	struct ip_hw_instance *ip_inst;
+
+	if (!ip_top)
+		return;
+
+	die_kset = &ip_top->die_kset;
+
+	spin_lock(&die_kset->list_lock);
+	list_for_each(el_die, &die_kset->list) {
+		ip_die_entry = to_ip_die_entry(list_to_kobj(el_die));
+
+		list_for_each(el_hw_id, &ip_die_entry->ip_kset.list) {
+			hw_id = to_ip_hw_id(list_to_kobj(el_hw_id));
+
+			list_for_each(el_hw_inst, &hw_id->hw_id_kset.list) {
+				ip_inst = to_ip_hw_instance(list_to_kobj(el_hw_inst));
+				ip_inst->harvest =
+					amdgpu_discovery_get_harvest_info(
+						adev, ip_inst->hw_id,
+						ip_inst->num_instance);
+			}
+		}
+	}
+	spin_unlock(&die_kset->list_lock);
+}
+
 static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev)
 {
 	uint8_t *discovery_bin = adev->discovery.bin;
@@ -1479,9 +1514,13 @@ static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev)
 	if (!discovery_bin)
 		return -EINVAL;
 
-	/* If early init already created sysfs in standalone mode, skip normal init */
-	if (adev->discovery.ip_top && adev->discovery.ip_top->standalone_mode)
+	/* If early init already created sysfs in standalone mode, update harvest info
+	 * now that adev is fully initialized, then skip the rest of normal init.
+	 */
+	if (adev->discovery.ip_top && adev->discovery.ip_top->standalone_mode) {
+		amdgpu_discovery_sysfs_update_harvest(adev);
 		return 0;
+	}
 
 	ip_top = kzalloc_obj(*ip_top);
 	if (!ip_top)
@@ -1536,8 +1575,6 @@ static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev)
 
 /* -------------------------------------------------- */
 
-#define list_to_kobj(el) container_of(el, struct kobject, entry)
-
 static void amdgpu_discovery_sysfs_ip_hw_free(struct ip_hw_id *ip_hw_id)
 {
 	struct list_head *el, *tmp;
Signature · 1 line
2.43.0
#1 lore raw
Quoted 8 lines · Kent Russell

After the earlier patch export IP discovery on probe failure, there was an unexpected consequence where harvest info was not populated. The early-exit in amdgpu_discovery_sysfs_init meant that we never called amdgpu_discovery_get_harvest_info, which is where we set the actual harvest value. The first time we call amdgpu_discovery_sysfs_recurse with NULL instead of adev, most values can get set. The 2nd time amdgpu_discovery_sysfs_recurse is called, we bail early.

Quoted 8 lines

To keep the logic of the first patch intact, ensuring that older kernels can still discover the IP blocks, add a separate call in the early-exit section that sets the harvest information. This should be the only functionality that is missed in this flow, the rest of the calls either work fine with adev=NULL, or use the discovery_bin directly.

Fixes 3ee1065e9830 ("drm/amdgpu: Export ip_discovery sysfs on probe failure")
Assisted-by Claude:claude-opus-4

This should be

Assisted-by LLM
Quoted 20 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 45 +++++++++++++++++--
  1 file changed, 41 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +7 -0
index 16e3129db6a1..342edbd02880 100644
@@ -1469,6 +1469,41 @@ static int amdgpu_discovery_sysfs_recurse(struct amdgpu_device *adev,
  	return 0;
  }
 
+#define list_to_kobj(el) container_of(el, struct kobject, entry)
+
+static void amdgpu_discovery_sysfs_update_harvest(struct amdgpu_device *adev)
+{
+	struct ip_discovery_top *ip_top = adev->discovery.ip_top;
+	struct ip_die_entry *ip_die_entry;
+	struct list_head *el_die, *el_hw_id, *el_hw_inst;

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_sysfs_recurse(struct amdgpu_device *adev, · line 1488

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +10 -0
+	struct ip_hw_id *hw_id;
+	struct kset *die_kset;
+	struct ip_hw_instance *ip_inst;
+
+	if (!ip_top)
+		return;
+
+	die_kset = &ip_top->die_kset;
+
+	spin_lock(&die_kset->list_lock);

Can you use this here:

guard(spinlock)(&die_kset->list_lock);

Then you don't need the explicit cleanup one at the end.

Quoted 46 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +24 -4
+	list_for_each(el_die, &die_kset->list) {
+		ip_die_entry = to_ip_die_entry(list_to_kobj(el_die));
+
+		list_for_each(el_hw_id, &ip_die_entry->ip_kset.list) {
+			hw_id = to_ip_hw_id(list_to_kobj(el_hw_id));
+
+			list_for_each(el_hw_inst, &hw_id->hw_id_kset.list) {
+				ip_inst = to_ip_hw_instance(list_to_kobj(el_hw_inst));
+				ip_inst->harvest =
+					amdgpu_discovery_get_harvest_info(
+						adev, ip_inst->hw_id,
+						ip_inst->num_instance);
+			}
+		}
+	}
+	spin_unlock(&die_kset->list_lock);
+}
+
  static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev)
  {
  	uint8_t *discovery_bin = adev->discovery.bin;
@@ -1479,9 +1514,13 @@ static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev)
  	if (!discovery_bin)
  		return -EINVAL;
 
-	/* If early init already created sysfs in standalone mode, skip normal init */
-	if (adev->discovery.ip_top && adev->discovery.ip_top->standalone_mode)
+	/* If early init already created sysfs in standalone mode, update harvest info
+	 * now that adev is fully initialized, then skip the rest of normal init.
+	 */
+	if (adev->discovery.ip_top && adev->discovery.ip_top->standalone_mode) {
+		amdgpu_discovery_sysfs_update_harvest(adev);
  		return 0;
+	}
 
  	ip_top = kzalloc_obj(*ip_top);
  	if (!ip_top)
@@ -1536,8 +1575,6 @@ static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev)
 
  /* -------------------------------------------------- */
 
-#define list_to_kobj(el) container_of(el, struct kobject, entry)
-
  static void amdgpu_discovery_sysfs_ip_hw_free(struct ip_hw_id *ip_hw_id)
  {
  	struct list_head *el, *tmp;
#2 lore raw

AMD General

Thanks, I see that https://docs.kernel.org/process/coding-assistants.html has changed since the last time I read it. I'll adjust it before submitting/v2.

Kent

Quoted 126 lines

-----Original Message-----
From: Limonciello, Mario <[email protected]>
Sent: October 26, 2026 1:00 PM
To: Russell, Kent <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: Ensure that harvest information gets set

Quoted 8 lines · Kent Russell

After the earlier patch export IP discovery on probe failure, there was an unexpected consequence where harvest info was not populated. The early-exit in amdgpu_discovery_sysfs_init meant that we never called amdgpu_discovery_get_harvest_info, which is where we set the actual harvest value. The first time we call amdgpu_discovery_sysfs_recurse with NULL instead of adev, most values can get set. The 2nd time amdgpu_discovery_sysfs_recurse is called, we bail early.

Quoted 7 lines

To keep the logic of the first patch intact, ensuring that older kernels can still discover the IP blocks, add a separate call in the early-exit section that sets the harvest information. This should be the only functionality that is missed in this flow, the rest of the calls either work fine with adev=NULL, or use the discovery_bin directly.

Fixes 3ee1065e9830 ("drm/amdgpu: Export ip_discovery sysfs on probe

failure")

Quoted 1 line
Assisted-by Claude:claude-opus-4

This should be

Assisted-by LLM
Quoted 3 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 45

+++++++++++++++++--

Review

Quoted 3 lines
  1 file changed, 41 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_sysfs_recurse(struct

Quoted 4 lines

index 16e3129db6a1..342edbd02880 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +0 -0
@@ -1469,6 +1469,41 @@ static int amdgpu_discovery_sysfs_recurse(struct

amdgpu_device *adev,

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_sysfs_recurse(struct amdgpu_device *adev,

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +3 -0
    return 0;
  }
 
+#define list_to_kobj(el) container_of(el, struct kobject, entry)
+
+static void amdgpu_discovery_sysfs_update_harvest(struct amdgpu_device

*adev)

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +4 -0
+{
+   struct ip_discovery_top *ip_top = adev->discovery.ip_top;
+   struct ip_die_entry *ip_die_entry;
+   struct list_head *el_die, *el_hw_id, *el_hw_inst;

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_sysfs_recurse(struct amdgpu_device *adev, · line 1488

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +10 -0
+   struct ip_hw_id *hw_id;
+   struct kset *die_kset;
+   struct ip_hw_instance *ip_inst;
+
+   if (!ip_top)
+           return;
+
+   die_kset = &ip_top->die_kset;
+
+   spin_lock(&die_kset->list_lock);

Can you use this here:

guard(spinlock)(&die_kset->list_lock);

Then you don't need the explicit cleanup one at the end.

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_sysfs_recurse(struct amdgpu_device *adev,

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +8 -0
+   list_for_each(el_die, &die_kset->list) {
+           ip_die_entry = to_ip_die_entry(list_to_kobj(el_die));
+
+           list_for_each(el_hw_id, &ip_die_entry->ip_kset.list) {
+                   hw_id = to_ip_hw_id(list_to_kobj(el_hw_id));
+
+                   list_for_each(el_hw_inst, &hw_id->hw_id_kset.list) {
+                           ip_inst =

to_ip_hw_instance(list_to_kobj(el_hw_inst));

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_sysfs_init(struct

Quoted 14 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +10 -0
+                           ip_inst->harvest =
+                                   amdgpu_discovery_get_harvest_info(
+                                           adev, ip_inst->hw_id,
+                                           ip_inst->num_instance);
+                   }
+           }
+   }
+   spin_unlock(&die_kset->list_lock);
+}
+
  static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev)
  {
    uint8_t *discovery_bin = adev->discovery.bin;
@@ -1479,9 +1514,13 @@ static int amdgpu_discovery_sysfs_init(struct

amdgpu_device *adev)

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev)

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +0 -1
    if (!discovery_bin)
            return -EINVAL;
 
-   /* If early init already created sysfs in standalone mode, skip normal init

*/

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_sysfs_init(struct · line 1518

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 -1
-   if (adev->discovery.ip_top && adev->discovery.ip_top-
 standalone_mode)
+   /* If early init already created sysfs in standalone mode, update harvest

info

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_sysfs_init(struct

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +5 -0
+    * now that adev is fully initialized, then skip the rest of normal init.
+    */
+   if (adev->discovery.ip_top && adev->discovery.ip_top-
 standalone_mode) {
+           amdgpu_discovery_sysfs_update_harvest(adev);
            return 0;
+   }
 
    ip_top = kzalloc_obj(*ip_top);
    if (!ip_top)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +0 -0
@@ -1536,8 +1575,6 @@ static int amdgpu_discovery_sysfs_init(struct

amdgpu_device *adev)

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +0 -2
  /* -------------------------------------------------- */
 
-#define list_to_kobj(el) container_of(el, struct kobject, entry)
-
  static void amdgpu_discovery_sysfs_ip_hw_free(struct ip_hw_id *ip_hw_id)
  {
    struct list_head *el, *tmp;
#3 lore raw
In reply to Kent Russell
Quoted 8 lines · Kent Russell

After the earlier patch export IP discovery on probe failure, there was an unexpected consequence where harvest info was not populated. The early-exit in amdgpu_discovery_sysfs_init meant that we never called amdgpu_discovery_get_harvest_info, which is where we set the actual harvest value. The first time we call amdgpu_discovery_sysfs_recurse with NULL instead of adev, most values can get set. The 2nd time amdgpu_discovery_sysfs_recurse is called, we bail early.

Are there any other IP discovery tables that get missed?

Alex

Quoted 88 lines

To keep the logic of the first patch intact, ensuring that older kernels can still discover the IP blocks, add a separate call in the early-exit section that sets the harvest information. This should be the only functionality that is missed in this flow, the rest of the calls either work fine with adev=NULL, or use the discovery_bin directly.

Fixes 3ee1065e9830 ("drm/amdgpu: Export ip_discovery sysfs on probe failure")
Assisted-by Claude:claude-opus-4
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 45 +++++++++++++++++--
 1 file changed, 41 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +41 -5
index 16e3129db6a1..342edbd02880 100644
@@ -1469,6 +1469,41 @@ static int amdgpu_discovery_sysfs_recurse(struct amdgpu_device *adev,
        return 0;
 }
 
+#define list_to_kobj(el) container_of(el, struct kobject, entry)
+
+static void amdgpu_discovery_sysfs_update_harvest(struct amdgpu_device *adev)
+{
+       struct ip_discovery_top *ip_top = adev->discovery.ip_top;
+       struct ip_die_entry *ip_die_entry;
+       struct list_head *el_die, *el_hw_id, *el_hw_inst;
+       struct ip_hw_id *hw_id;
+       struct kset *die_kset;
+       struct ip_hw_instance *ip_inst;
+
+       if (!ip_top)
+               return;
+
+       die_kset = &ip_top->die_kset;
+
+       spin_lock(&die_kset->list_lock);
+       list_for_each(el_die, &die_kset->list) {
+               ip_die_entry = to_ip_die_entry(list_to_kobj(el_die));
+
+               list_for_each(el_hw_id, &ip_die_entry->ip_kset.list) {
+                       hw_id = to_ip_hw_id(list_to_kobj(el_hw_id));
+
+                       list_for_each(el_hw_inst, &hw_id->hw_id_kset.list) {
+                               ip_inst = to_ip_hw_instance(list_to_kobj(el_hw_inst));
+                               ip_inst->harvest =
+                                       amdgpu_discovery_get_harvest_info(
+                                               adev, ip_inst->hw_id,
+                                               ip_inst->num_instance);
+                       }
+               }
+       }
+       spin_unlock(&die_kset->list_lock);
+}
+
 static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev)
 {
        uint8_t *discovery_bin = adev->discovery.bin;
@@ -1479,9 +1514,13 @@ static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev)
        if (!discovery_bin)
                return -EINVAL;
 
-       /* If early init already created sysfs in standalone mode, skip normal init */
-       if (adev->discovery.ip_top && adev->discovery.ip_top->standalone_mode)
+       /* If early init already created sysfs in standalone mode, update harvest info
+        * now that adev is fully initialized, then skip the rest of normal init.
+        */
+       if (adev->discovery.ip_top && adev->discovery.ip_top->standalone_mode) {
+               amdgpu_discovery_sysfs_update_harvest(adev);
                return 0;
+       }
 
        ip_top = kzalloc_obj(*ip_top);
        if (!ip_top)
@@ -1536,8 +1575,6 @@ static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev)
 
 /* -------------------------------------------------- */
 
-#define list_to_kobj(el) container_of(el, struct kobject, entry)
-
 static void amdgpu_discovery_sysfs_ip_hw_free(struct ip_hw_id *ip_hw_id)
 {
        struct list_head *el, *tmp;
--

2.43.0

#4 lore raw

AMD General

Quoted 18 lines

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: October 26, 2026 1:29 PM
To: Russell, Kent <[email protected]>
Cc: [email protected]; Limonciello, Mario <[email protected]>; Zhang, Hawking <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: Ensure that harvest information gets set

Quoted 8 lines · Kent Russell

After the earlier patch export IP discovery on probe failure, there was an unexpected consequence where harvest info was not populated. The early-exit in amdgpu_discovery_sysfs_init meant that we never called amdgpu_discovery_get_harvest_info, which is where we set the actual harvest value. The first time we call amdgpu_discovery_sysfs_recurse with NULL instead of adev, most values can get set. The 2nd time amdgpu_discovery_sysfs_recurse is called, we bail early.

Quoted 1 line

Are there any other IP discovery tables that get missed?

The other blocks are all covered. They either don’t have adev==NULL checks, or they avoid adev and use the IP discovery bin. This was the only unique case where adev==NULL was handled differently.

Kent

Quoted 100 lines

Alex

Quoted 8 lines

To keep the logic of the first patch intact, ensuring that older kernels can still discover the IP blocks, add a separate call in the early-exit section that sets the harvest information. This should be the only functionality that is missed in this flow, the rest of the calls either work fine with adev=NULL, or use the discovery_bin directly.

Fixes 3ee1065e9830 ("drm/amdgpu: Export ip_discovery sysfs on probe

failure")

Quoted 4 lines
Assisted-by Claude:claude-opus-4
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 45

+++++++++++++++++--

Review

Quoted 3 lines
 1 file changed, 41 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_sysfs_recurse(struct

Quoted 4 lines

index 16e3129db6a1..342edbd02880 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +0 -0
@@ -1469,6 +1469,41 @@ static int amdgpu_discovery_sysfs_recurse(struct

amdgpu_device *adev,

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_sysfs_recurse(struct amdgpu_device *adev,

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +3 -0
        return 0;
 }
 
+#define list_to_kobj(el) container_of(el, struct kobject, entry)
+
+static void amdgpu_discovery_sysfs_update_harvest(struct amdgpu_device

*adev)

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_sysfs_init(struct

Quoted 36 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +32 -0
+{
+       struct ip_discovery_top *ip_top = adev->discovery.ip_top;
+       struct ip_die_entry *ip_die_entry;
+       struct list_head *el_die, *el_hw_id, *el_hw_inst;
+       struct ip_hw_id *hw_id;
+       struct kset *die_kset;
+       struct ip_hw_instance *ip_inst;
+
+       if (!ip_top)
+               return;
+
+       die_kset = &ip_top->die_kset;
+
+       spin_lock(&die_kset->list_lock);
+       list_for_each(el_die, &die_kset->list) {
+               ip_die_entry = to_ip_die_entry(list_to_kobj(el_die));
+
+               list_for_each(el_hw_id, &ip_die_entry->ip_kset.list) {
+                       hw_id = to_ip_hw_id(list_to_kobj(el_hw_id));
+
+                       list_for_each(el_hw_inst, &hw_id->hw_id_kset.list) {
+                               ip_inst = to_ip_hw_instance(list_to_kobj(el_hw_inst));
+                               ip_inst->harvest =
+                                       amdgpu_discovery_get_harvest_info(
+                                               adev, ip_inst->hw_id,
+                                               ip_inst->num_instance);
+                       }
+               }
+       }
+       spin_unlock(&die_kset->list_lock);
+}
+
 static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev)
 {
        uint8_t *discovery_bin = adev->discovery.bin;
@@ -1479,9 +1514,13 @@ static int amdgpu_discovery_sysfs_init(struct

amdgpu_device *adev)

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev)

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 -2
        if (!discovery_bin)
                return -EINVAL;
 
-       /* If early init already created sysfs in standalone mode, skip normal init */
-       if (adev->discovery.ip_top && adev->discovery.ip_top->standalone_mode)
+       /* If early init already created sysfs in standalone mode, update harvest

info

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_sysfs_init(struct amdgpu_device *adev)

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +3 -0
+        * now that adev is fully initialized, then skip the rest of normal init.
+        */
+       if (adev->discovery.ip_top && adev->discovery.ip_top->standalone_mode)

{

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c static int amdgpu_discovery_sysfs_init(struct

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +2 -0
+               amdgpu_discovery_sysfs_update_harvest(adev);
                return 0;
+       }
 
        ip_top = kzalloc_obj(*ip_top);
        if (!ip_top)
@@ -1536,8 +1575,6 @@ static int amdgpu_discovery_sysfs_init(struct

amdgpu_device *adev)

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +0 -3
 /* -------------------------------------------------- */
 
-#define list_to_kobj(el) container_of(el, struct kobject, entry)
-
 static void amdgpu_discovery_sysfs_ip_hw_free(struct ip_hw_id *ip_hw_id)
 {
        struct list_head *el, *tmp;
--

2.43.0