]> Gentwo Git Trees - linux/.git/commitdiff
drm/amdgpu: Avoid xgmi register access
authorLijo Lazar <lijo.lazar@amd.com>
Thu, 6 Nov 2025 08:19:59 +0000 (13:49 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Nov 2025 16:26:58 +0000 (11:26 -0500)
On single GPU systems, avoid accesses to XGMI link registers.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c

index 2f553af1d2a3e4da595b35aabce84f3934499e38..10e42b0ff7a27fe525602bea3a736b7a9e3b5dfc 100644 (file)
@@ -298,6 +298,9 @@ int amdgpu_xgmi_get_ext_link(struct amdgpu_device *adev, int link_num)
 {
        int link_map_6_4_x[8] = { 0, 3, 1, 2, 7, 6, 4, 5 };
 
+       if (adev->gmc.xgmi.num_physical_nodes <= 1)
+               return -EINVAL;
+
        switch (amdgpu_ip_version(adev, XGMI_HWIP, 0)) {
        case IP_VERSION(6, 4, 0):
        case IP_VERSION(6, 4, 1):
@@ -346,6 +349,9 @@ int amdgpu_get_xgmi_link_status(struct amdgpu_device *adev, int global_link_num)
 {
        u32 xgmi_state_reg_val;
 
+       if (adev->gmc.xgmi.num_physical_nodes <= 1)
+               return -EINVAL;
+
        switch (amdgpu_ip_version(adev, XGMI_HWIP, 0)) {
        case IP_VERSION(6, 4, 0):
        case IP_VERSION(6, 4, 1):