Skip to contentSkip to conversation

drm/amd/amdgpu: fix Polaris10 PCIe dpm feature issue (v2)

PATCH New Chengming Gui 1 participant 1 message Mar 21, 2019

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

PATCH 1/1 drm/amd/amdgpu: fix Polaris10 PCIe dpm feature issue (v2)

use pcie_bandwidth_available to get real link state to update pcie table.

v2: fix incorrect initialized return value

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -0
index 964a4d3..680643f 100644
@@ -3649,7 +3649,9 @@ static void amdgpu_device_get_min_pci_speed_width(struct amdgpu_device *adev,
 {
 	struct pci_dev *pdev = adev->pdev;
 	enum pci_bus_speed cur_speed;
+	enum pci_bus_speed tmp_speed;
 	enum pcie_link_width cur_width;
+	u32 ret = 1;
 
 	*speed = PCI_SPEED_UNKNOWN;
 	*width = PCIE_LNK_WIDTH_UNKNOWN;
@@ -3657,6 +3659,11 @@ static void amdgpu_device_get_min_pci_speed_width(struct amdgpu_device *adev,
 	while (pdev) {
 		cur_speed = pcie_get_speed_cap(pdev);
 		cur_width = pcie_get_width_cap(pdev);
+		if (adev->asic_type == CHIP_POLARIS10)
+			ret = pcie_bandwidth_available(adev->pdev, NULL,
+						       &tmp_speed, &cur_width);
+		if (!ret)
+			cur_width = PCIE_LNK_WIDTH_RESRV;
 
 		if (cur_speed != PCI_SPEED_UNKNOWN) {
 			if (*speed == PCI_SPEED_UNKNOWN)
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx