From: Hawking Zhang <[email protected]>

gfxhub v12_1 is not always on. querying xgmi info
from it may not work consistently

Signed-off-by: Hawking Zhang <[email protected]>
Reviewed-by: Le Ma <[email protected]>
Reviewed-by: Feifei Xu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c | 42 -----------------------
 1 file changed, 42 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c 
b/drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c
index d086c23e4c2da..3544eb42dca60 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c
@@ -822,47 +822,6 @@ static void gfxhub_v12_1_init(struct amdgpu_device *adev)
        gfxhub_v12_1_xcc_init(adev, xcc_mask);
 }
 
-static int gfxhub_v12_1_get_xgmi_info(struct amdgpu_device *adev)
-{
-       u32 max_num_physical_nodes;
-       u32 max_physical_node_id;
-       u32 xgmi_lfb_cntl;
-       u32 max_region;
-       u64 seg_size;
-
-       xgmi_lfb_cntl = RREG32_SOC15(GC, GET_INST(GC, 0),
-                                    regGCMC_VM_XGMI_LFB_CNTL);
-       seg_size = REG_GET_FIELD(RREG32_SOC15(GC, GET_INST(GC, 0),
-                                regGCMC_VM_XGMI_LFB_SIZE),
-                                GCMC_VM_XGMI_LFB_SIZE, PF_LFB_SIZE) << 24;
-       max_region = REG_GET_FIELD(xgmi_lfb_cntl,
-                                  GCMC_VM_XGMI_LFB_CNTL,
-                                  PF_MAX_REGION);
-
-       max_num_physical_nodes   = 8;
-       max_physical_node_id     = 7;
-
-       /* PF_MAX_REGION=0 means xgmi is disabled */
-       if (max_region || adev->gmc.xgmi.connected_to_cpu) {
-               adev->gmc.xgmi.num_physical_nodes = max_region + 1;
-
-               if (adev->gmc.xgmi.num_physical_nodes > max_num_physical_nodes)
-                       return -EINVAL;
-
-               adev->gmc.xgmi.physical_node_id =
-                       REG_GET_FIELD(xgmi_lfb_cntl,
-                                     GCMC_VM_XGMI_LFB_CNTL,
-                                     PF_LFB_REGION);
-
-               if (adev->gmc.xgmi.physical_node_id > max_physical_node_id)
-                       return -EINVAL;
-
-               adev->gmc.xgmi.node_segment_size = seg_size;
-       }
-
-       return 0;
-}
-
 const struct amdgpu_gfxhub_funcs gfxhub_v12_1_funcs = {
        .get_fb_location = gfxhub_v12_1_get_fb_location,
        .get_mc_fb_offset = gfxhub_v12_1_get_mc_fb_offset,
@@ -871,7 +830,6 @@ const struct amdgpu_gfxhub_funcs gfxhub_v12_1_funcs = {
        .gart_disable = gfxhub_v12_1_gart_disable,
        .set_fault_enable_default = gfxhub_v12_1_set_fault_enable_default,
        .init = gfxhub_v12_1_init,
-       .get_xgmi_info = gfxhub_v12_1_get_xgmi_info,
 };
 
 static int gfxhub_v12_1_xcp_resume(void *handle, uint32_t inst_mask)
-- 
2.53.0

Reply via email to