]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu: Query xgmi info from mmhub if available
authorHawking Zhang <Hawking.Zhang@amd.com>
Sat, 17 Jan 2026 12:33:06 +0000 (20:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Mar 2026 14:32:38 +0000 (10:32 -0400)
Query xgmi info from mmhub if available

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-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_device.c

index 711b4502653a2081563ad1d3df670986137b1032..75df85aecac51975834dd5ec770ed03770654361 100644 (file)
@@ -3878,9 +3878,21 @@ int amdgpu_device_init(struct amdgpu_device *adev,
        amdgpu_gmc_noretry_set(adev);
        /* Need to get xgmi info early to decide the reset behavior*/
        if (adev->gmc.xgmi.supported) {
-               r = adev->gfxhub.funcs->get_xgmi_info(adev);
-               if (r)
-                       return r;
+               if (adev->gfxhub.funcs &&
+                   adev->gfxhub.funcs->get_xgmi_info) {
+                       r = adev->gfxhub.funcs->get_xgmi_info(adev);
+                       if (r)
+                               return r;
+               }
+       }
+
+       if (adev->gmc.xgmi.connected_to_cpu) {
+               if (adev->mmhub.funcs &&
+                   adev->mmhub.funcs->get_xgmi_info) {
+                       r = adev->mmhub.funcs->get_xgmi_info(adev);
+                       if (r)
+                               return r;
+               }
        }
 
        /* enable PCIE atomic ops */