Skip to contentSkip to conversation

drm/amdgpu: Each PSP need to get latest topology info on XGMI configuration

PATCH In review Liu, Shaoyun 3 participants 4 messages Nov 8, 2018 – Nov 9, 2018 2 messages not in the archive

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

PATCH 1/1 drm/amdgpu: Each PSP need to get latest topology info on XGMI configuration

From: shaoyunl <[email protected]>

Driver need to call each psp instance to get topology info before set topology

Change-Id I20d914a0c678686db3f1f99edf250f3656ec9fc1
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +12 -7
index 56acdea..909216a 100644
@@ -88,14 +88,19 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev)
 	list_for_each_entry(entry, &hive->device_list, head)
 		tmp_topology->nodes[count++].node_id = entry->node_id;
 
-	ret = psp_xgmi_get_topology_info(&adev->psp, count, tmp_topology);
-	if (ret) {
-		dev_err(adev->dev,
-			"XGMI: Get topology failure on device %llx, hive %llx, ret %d",
-			adev->gmc.xgmi.node_id,
-			adev->gmc.xgmi.hive_id, ret);
-		goto exit;
+	/* Each psp need to get the latest topology */
+	list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
+		ret = psp_xgmi_get_topology_info(&tmp_adev->psp, count, tmp_topology);
+		if (ret) {
+			dev_err(tmp_adev->dev,
+				"XGMI: Get topology failure on device %llx, hive %llx, ret %d",
+				tmp_adev->gmc.xgmi.node_id,
+				tmp_adev->gmc.xgmi.hive_id, ret);
+			/* To do : continue with some node failed or disable the whole hive */
+			break;
+		}
 	}
+
 	/* Each psp need to set the latest topology */
 	list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
 		ret = psp_xgmi_set_topology_info(&tmp_adev->psp, count, tmp_topology);
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1541693634-30166-1-git-send-email-shaoyun.liu-5C7GfCeVMHo@public.gmane.org

Reviewed-by Hawking Zhang
#2 lore raw

Regards,
Hawking

Sent from my iPhone

Quoted 50 lines · Shaoyun

From: shaoyunl <[email protected]>

Driver need to call each psp instance to get topology info before set topology

Change-Id I20d914a0c678686db3f1f99edf250f3656ec9fc1

---
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 19 ++++++++++++-------

1 file changed, 12 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +12 -7
index 56acdea..909216a 100644
@@ -88,14 +88,19 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev)
   list_for_each_entry(entry, &hive->device_list, head)
       tmp_topology->nodes[count++].node_id = entry->node_id;
 
-    ret = psp_xgmi_get_topology_info(&adev->psp, count, tmp_topology);
-    if (ret) {
-        dev_err(adev->dev,
-            "XGMI: Get topology failure on device %llx, hive %llx, ret %d",
-            adev->gmc.xgmi.node_id,
-            adev->gmc.xgmi.hive_id, ret);
-        goto exit;
+    /* Each psp need to get the latest topology */
+    list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
+        ret = psp_xgmi_get_topology_info(&tmp_adev->psp, count, tmp_topology);
+        if (ret) {
+            dev_err(tmp_adev->dev,
+                "XGMI: Get topology failure on device %llx, hive %llx, ret %d",
+                tmp_adev->gmc.xgmi.node_id,
+                tmp_adev->gmc.xgmi.hive_id, ret);
+            /* To do : continue with some node failed or disable the whole hive */
+            break;
+        }
   }
+
   /* Each psp need to set the latest topology */
   list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
       ret = psp_xgmi_set_topology_info(&tmp_adev->psp, count, tmp_topology);
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by Andrey Grodzovsky
#3 lore raw
In reply to a message not in the archive

Question - shouldn't we also set psp_xgmi_node_info.is_sharing_enabled to 1 to enable FB sharing ?

Andrey

Quoted 31 lines · Shaoyun

From: shaoyunl <[email protected]>

Driver need to call each psp instance to get topology info before set topology

Change-Id I20d914a0c678686db3f1f99edf250f3656ec9fc1
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 19 ++++++++++++-------
  1 file changed, 12 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +6 -7
index 56acdea..909216a 100644
@@ -88,14 +88,19 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev)
  	list_for_each_entry(entry, &hive->device_list, head)
  		tmp_topology->nodes[count++].node_id = entry->node_id;
 
-	ret = psp_xgmi_get_topology_info(&adev->psp, count, tmp_topology);
-	if (ret) {
-		dev_err(adev->dev,
-			"XGMI: Get topology failure on device %llx, hive %llx, ret %d",
-			adev->gmc.xgmi.node_id,
-			adev->gmc.xgmi.hive_id, ret);
-		goto exit;
+	/* Each psp need to get the latest topology */
+	list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
+		ret = psp_xgmi_get_topology_info(&tmp_adev->psp, count, tmp_topology);
+		if (ret) {
+			dev_err(tmp_adev->dev,
+				"XGMI: Get topology failure on device %llx, hive %llx, ret %d",

drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c int amdgpu_xgmi_add_device(struct amdgpu_device *adev) · line 106

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +6 -0
+				tmp_adev->gmc.xgmi.node_id,
+				tmp_adev->gmc.xgmi.hive_id, ret);
+			/* To do : continue with some node failed or disable the whole hive */
+			break;
+		}
  	}
+
  	/* Each psp need to set the latest topology */
  	list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
  		ret = psp_xgmi_set_topology_info(&tmp_adev->psp, count, tmp_topology);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 16420cc5-d299-2b30-7a9d-cb604c8bf3ef-5C7GfCeVMHo@public.gmane.org

#5 lore raw

For now we depends on the  TA(firmware)  to decided whether the memory will be shared or not . They always been  set to enabled within same hive .

Regards

shaoyun.liu

Quoted 42 lines · Andrey

Question - shouldn't we also set psp_xgmi_node_info.is_sharing_enabled to 1 to enable FB sharing ?

Andrey

Quoted 33 lines · Shaoyun

From: shaoyunl <[email protected]>

Driver need to call each psp instance to get topology info before set topology

Change-Id I20d914a0c678686db3f1f99edf250f3656ec9fc1
---
   drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 19 ++++++++++++-------
   1 file changed, 12 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +8 -7
index 56acdea..909216a 100644
@@ -88,14 +88,19 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev)
   	list_for_each_entry(entry, &hive->device_list, head)
   		tmp_topology->nodes[count++].node_id = entry->node_id;
 
-	ret = psp_xgmi_get_topology_info(&adev->psp, count, tmp_topology);
-	if (ret) {
-		dev_err(adev->dev,
-			"XGMI: Get topology failure on device %llx, hive %llx, ret %d",
-			adev->gmc.xgmi.node_id,
-			adev->gmc.xgmi.hive_id, ret);
-		goto exit;
+	/* Each psp need to get the latest topology */
+	list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
+		ret = psp_xgmi_get_topology_info(&tmp_adev->psp, count, tmp_topology);
+		if (ret) {
+			dev_err(tmp_adev->dev,
+				"XGMI: Get topology failure on device %llx, hive %llx, ret %d",
+				tmp_adev->gmc.xgmi.node_id,
+				tmp_adev->gmc.xgmi.hive_id, ret);
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c int amdgpu_xgmi_add_device(struct amdgpu_device *adev) · line 106

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +4 -0
+			/* To do : continue with some node failed or disable the whole hive */
+			break;
+		}
   	}
+
   	/* Each psp need to set the latest topology */
   	list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
   		ret = psp_xgmi_set_topology_info(&tmp_adev->psp, count, tmp_topology);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx