diff options
author | Alex Sierra <alex.sierra@amd.com> | 2022-08-25 15:42:08 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2022-08-30 17:07:43 -0400 |
commit | b97e914552c3fcea71ce03f899e285f2178ec38b (patch) | |
tree | dc7b75bec0d815185573fc0f0ae834fea3492189 | |
parent | 2640174f4a139502f603f7bedf3a7011db714e1d (diff) | |
download | linux-b97e914552c3fcea71ce03f899e285f2178ec38b.tar.gz linux-b97e914552c3fcea71ce03f899e285f2178ec38b.tar.bz2 linux-b97e914552c3fcea71ce03f899e285f2178ec38b.zip |
drm/amdgpu: ensure no PCIe peer access for CPU XGMI iolinks
[Why] Devices with CPU XGMI iolink do not support PCIe peer access.
Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index f095a2513aff..1400abee9f40 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -5524,7 +5524,8 @@ bool amdgpu_device_is_peer_accessible(struct amdgpu_device *adev, ~*peer_adev->dev->dma_mask : ~((1ULL << 32) - 1); resource_size_t aper_limit = adev->gmc.aper_base + adev->gmc.aper_size - 1; - bool p2p_access = !(pci_p2pdma_distance_many(adev->pdev, + bool p2p_access = !adev->gmc.xgmi.connected_to_cpu && + !(pci_p2pdma_distance_many(adev->pdev, &peer_adev->dev, 1, true) < 0); return pcie_p2p && p2p_access && (adev->gmc.visible_vram_size && |