Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit ba46b3b

Browse files
committed
drm/amdgpu: Adjust logic in amdgpu_device_partner_bandwidth()
Use current speed/width on devices which don't support dynamic PCIe switching. Fixes: 466a7d1 ("drm/amd: Use the first non-dGPU PCI device for BW limits") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3289 Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 8195979 commit ba46b3b

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5944,13 +5944,18 @@ static void amdgpu_device_partner_bandwidth(struct amdgpu_device *adev,
59445944
*speed = PCI_SPEED_UNKNOWN;
59455945
*width = PCIE_LNK_WIDTH_UNKNOWN;
59465946

5947-
while ((parent = pci_upstream_bridge(parent))) {
5948-
/* skip upstream/downstream switches internal to dGPU*/
5949-
if (parent->vendor == PCI_VENDOR_ID_ATI)
5950-
continue;
5951-
*speed = pcie_get_speed_cap(parent);
5952-
*width = pcie_get_width_cap(parent);
5953-
break;
5947+
if (amdgpu_device_pcie_dynamic_switching_supported(adev)) {
5948+
while ((parent = pci_upstream_bridge(parent))) {
5949+
/* skip upstream/downstream switches internal to dGPU*/
5950+
if (parent->vendor == PCI_VENDOR_ID_ATI)
5951+
continue;
5952+
*speed = pcie_get_speed_cap(parent);
5953+
*width = pcie_get_width_cap(parent);
5954+
break;
5955+
}
5956+
} else {
5957+
/* use the current speeds rather than max if switching is not supported */
5958+
pcie_bandwidth_available(adev->pdev, NULL, speed, width);
59545959
}
59555960
}
59565961

0 commit comments

Comments
 (0)