drm/amdgpu: Adjust logic in amdgpu_device_partner_bandwidth()
Subsystems (2)
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: Adjust logic in amdgpu_device_partner_bandwidth()
Use current speed/width on devices which don't support dynamic PCIe switching.
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +12 -7
@@ -5946,13 +5946,18 @@ static void amdgpu_device_partner_bandwidth(struct amdgpu_device *adev, *speed =PCI_SPEED_UNKNOWN ; *width =PCIE_LNK_WIDTH_UNKNOWN ; -while ((parent =pci_upstream_bridge (parent))) { -/* skip upstream/downstream switches internal to dGPU*/ -if (parent->vendor ==PCI_VENDOR_ID_ATI ) -continue ; - *speed =pcie_get_speed_cap (parent); - *width =pcie_get_width_cap (parent); -break ; +if (amdgpu_device_pcie_dynamic_switching_supported (adev)) { +while ((parent =pci_upstream_bridge (parent))) { +/* skip upstream/downstream switches internal to dGPU*/ +if (parent->vendor ==PCI_VENDOR_ID_ATI ) +continue ; + *speed =pcie_get_speed_cap (parent); + *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); } }
Signature · 1 line
2.45.0
Ping?
Quoted 43 lines · Alex Deucher
Use current speed/width on devices which don't support dynamic PCIe switching.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +12
-8@@ -5946,13 +5946,18 @@ static void amdgpu_device_partner_bandwidth(struct amdgpu_device *adev, *speed =PCI_SPEED_UNKNOWN ; *width =PCIE_LNK_WIDTH_UNKNOWN ; -while ((parent =pci_upstream_bridge (parent))) { -/* skip upstream/downstream switches internal to dGPU*/ -if (parent->vendor ==PCI_VENDOR_ID_ATI ) -continue ; - *speed =pcie_get_speed_cap (parent); - *width =pcie_get_width_cap (parent); -break ; +if (amdgpu_device_pcie_dynamic_switching_supported (adev)) { +while ((parent =pci_upstream_bridge (parent))) { +/* skip upstream/downstream switches internal to dGPU*/ +if (parent->vendor ==PCI_VENDOR_ID_ATI ) +continue ; + *speed =pcie_get_speed_cap (parent); + *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); } } --2.45.0
Am 16.05.24 um 17:05 schrieb Alex Deucher:
Quoted 5 lines
Use current speed/width on devices which don't support dynamic PCIe switching.
Signed-off-by Alex Deucher <[email protected]>
Acked-by Christian König <[email protected]>
Quoted 34 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +12
-7@@ -5946,13 +5946,18 @@ static void amdgpu_device_partner_bandwidth(struct amdgpu_device *adev, *speed =PCI_SPEED_UNKNOWN ; *width =PCIE_LNK_WIDTH_UNKNOWN ; -while ((parent =pci_upstream_bridge (parent))) { -/* skip upstream/downstream switches internal to dGPU*/ -if (parent->vendor ==PCI_VENDOR_ID_ATI ) -continue ; - *speed =pcie_get_speed_cap (parent); - *width =pcie_get_width_cap (parent); -break ; +if (amdgpu_device_pcie_dynamic_switching_supported (adev)) { +while ((parent =pci_upstream_bridge (parent))) { +/* skip upstream/downstream switches internal to dGPU*/ +if (parent->vendor ==PCI_VENDOR_ID_ATI ) +continue ; + *speed =pcie_get_speed_cap (parent); + *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); } }