aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2955-drm-amdgpu-skip-get-update-xgmi-topology-info-when-n.patch
blob: 216c3552dd07715b6b487272c998ea1c64b9d9c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
From 488e98e88d53c8861a5e33b5824a93a8f97d2c19 Mon Sep 17 00:00:00 2001
From: Le Ma <le.ma@amd.com>
Date: Tue, 4 Jun 2019 14:58:49 +0800
Subject: [PATCH 2955/4256] drm/amdgpu: skip get/update xgmi topology info when
 no psp exists

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 48 +++++++++++++-----------
 1 file changed, 26 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
index 1725c1ec1536..64940759d8c0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
@@ -296,7 +296,7 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev)
 	struct amdgpu_xgmi	*entry;
 	struct amdgpu_device *tmp_adev = NULL;
 
-	int count = 0, ret = -EINVAL;
+	int count = 0, ret = 0;
 
 	if (!adev->gmc.xgmi.supported)
 		return 0;
@@ -337,28 +337,32 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev)
 	top_info->num_nodes = count;
 	hive->number_devices = count;
 
-	list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
-                /* update node list for other device in the hive */
-                if (tmp_adev != adev) {
-                        top_info = &tmp_adev->psp.xgmi_context.top_info;
-                        top_info->nodes[count - 1].node_id = adev->gmc.xgmi.node_id;
-                        top_info->num_nodes = count;
+        if (amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_PSP)) {
+                list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
+                        /* update node list for other device in the hive */
+                        if (tmp_adev != adev) {
+                                top_info = &tmp_adev->psp.xgmi_context.top_info;
+                                top_info->nodes[count - 1].node_id =
+                                       adev->gmc.xgmi.node_id;
+                                top_info->num_nodes = count;
+                        }
+                        ret = amdgpu_xgmi_update_topology(hive, tmp_adev);
+                        if (ret)
+                                goto exit;
                 }
-                ret = amdgpu_xgmi_update_topology(hive, tmp_adev);
-                if (ret)
-                        goto exit;
-        }
-
-        /* get latest topology info for each device from psp */
-        list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
-		ret = psp_xgmi_get_topology_info(&tmp_adev->psp, count, top_info);
-		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 */
-			goto exit;
+                /* get latest topology info for each device from psp */
+                list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
+                        ret = psp_xgmi_get_topology_info(&tmp_adev->psp, count,
+                                        &tmp_adev->psp.xgmi_context.top_info);
+                        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 */
+                                goto exit;
+                        }
+
 		}
 	}
 
-- 
2.17.1