Skip to contentSkip to conversation

drm/amdgpu: Fix missing check pcie_p2p module param

PATCH In review Bob Zhou 2 participants 2 messages Sep 6, 2024

Subsystems (2)
lore
Share & tools
lore

Bob Zhou

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix missing check pcie_p2p module param

The module param pcie_p2p should be checked for kfd p2p feature, so add it.

Fixes a9b55f03989a ("drm/amdgpu: Take IOMMU remapping into account for p2p checks")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
index 61a189e30bcd..20910c0187c7 100644
@@ -6189,7 +6189,7 @@ bool amdgpu_device_is_peer_accessible(struct amdgpu_device *adev,
 		p2p_addressable = !(adev->gmc.aper_base & address_mask ||
 				     aper_limit & address_mask);
 	}
-	return is_large_bar && p2p_access && p2p_addressable;
+	return pcie_p2p && is_large_bar && p2p_access && p2p_addressable;
 #else
 	return false;
 #endif
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Bob Zhou

The module param pcie_p2p should be checked for kfd p2p feature, so add it.

Fixes a9b55f03989a ("drm/amdgpu: Take IOMMU remapping into account for p2p checks")
Quoted 20 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -2
index 61a189e30bcd..20910c0187c7 100644
@@ -6189,7 +6189,7 @@ bool amdgpu_device_is_peer_accessible(struct amdgpu_device *adev,
                p2p_addressable = !(adev->gmc.aper_base & address_mask ||
                                     aper_limit & address_mask);
        }
-       return is_large_bar && p2p_access && p2p_addressable;
+       return pcie_p2p && is_large_bar && p2p_access && p2p_addressable;
 #else
        return false;
 #endif
--

2.34.1