Skip to contentSkip to conversation

drm/amdgpu: Inform if PCIe based P2P links are not available

PATCH In review Ramesh Errabolu 2 participants 2 messages Nov 6, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 drm/amdgpu: Inform if PCIe based P2P links are not available

Raise an info message in kernel log if PCIe root complex determines that a AMD GPU device D<i> cannot have P2P communication with another AMD GPU device D<j>

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
index 230c24638a34..76182d5c719d 100644
@@ -6222,6 +6222,9 @@ bool amdgpu_device_is_peer_accessible(struct amdgpu_device *adev,
 	bool p2p_access =
 		!adev->gmc.xgmi.connected_to_cpu &&
 		!(pci_p2pdma_distance(adev->pdev, peer_adev->dev, false) < 0);
+	if (!p2p_access)
+		dev_info(adev->dev, "has no link with Peer device: %s\n",
+			pci_name(peer_adev->pdev));
 
 	bool is_large_bar = adev->gmc.visible_vram_size &&
 		adev->gmc.real_vram_size == adev->gmc.visible_vram_size;
Signature · 1 line
2.34.1
Reviewed-by on v3 1/1
#1 lore raw
Quoted 14 lines · Ramesh Errabolu

Raise an info message in kernel log if PCIe root complex determines that a AMD GPU device D<i> cannot have P2P communication with another AMD GPU device D<j>

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 230c24638a34..76182d5c719d 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c bool amdgpu_device_is_peer_accessible(struct amdgpu_device *adev, · line 6227

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
@@ -6222,6 +6222,9 @@ bool amdgpu_device_is_peer_accessible(struct amdgpu_device *adev,
 	bool p2p_access =
 		!adev->gmc.xgmi.connected_to_cpu &&
 		!(pci_p2pdma_distance(adev->pdev, peer_adev->dev, false) < 0);
+	if (!p2p_access)
+		dev_info(adev->dev, "has no link with Peer device: %s\n",
+			pci_name(peer_adev->pdev));

Please clarify the message to say "PCIe P2P access from peer device %s is not supported by the chipset". And "peer" should not be capitalized. With that fixed, the patch is

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
 	bool is_large_bar = adev->gmc.visible_vram_size &&
 		adev->gmc.real_vram_size == adev->gmc.visible_vram_size;