Commit ba46b3bd authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu: Adjust logic in amdgpu_device_partner_bandwidth()

Use current speed/width on devices which don't support
dynamic PCIe switching.

Fixes: 466a7d11 ("drm/amd: Use the first non-dGPU PCI device for BW limits")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3289Acked-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8195979d
...@@ -5944,13 +5944,18 @@ static void amdgpu_device_partner_bandwidth(struct amdgpu_device *adev, ...@@ -5944,13 +5944,18 @@ static void amdgpu_device_partner_bandwidth(struct amdgpu_device *adev,
*speed = PCI_SPEED_UNKNOWN; *speed = PCI_SPEED_UNKNOWN;
*width = PCIE_LNK_WIDTH_UNKNOWN; *width = PCIE_LNK_WIDTH_UNKNOWN;
while ((parent = pci_upstream_bridge(parent))) { if (amdgpu_device_pcie_dynamic_switching_supported(adev)) {
/* skip upstream/downstream switches internal to dGPU*/ while ((parent = pci_upstream_bridge(parent))) {
if (parent->vendor == PCI_VENDOR_ID_ATI) /* skip upstream/downstream switches internal to dGPU*/
continue; if (parent->vendor == PCI_VENDOR_ID_ATI)
*speed = pcie_get_speed_cap(parent); continue;
*width = pcie_get_width_cap(parent); *speed = pcie_get_speed_cap(parent);
break; *width = pcie_get_width_cap(parent);
break;
}
} else {
/* use the current speeds rather than max if switching is not supported */
pcie_bandwidth_available(adev->pdev, NULL, speed, width);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment