Skip to contentSkip to conversation

drm/amd: Check if ASPM is enabled from PCIe subsystem

PATCH In review Mario Limonciello 3 participants 5 messages Feb 17, 2022

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

PATCH 1/1 drm/amd: Check if ASPM is enabled from PCIe subsystem

commit 0064b0ce85bb ("drm/amd/pm: enable ASPM by default") enabled ASPM by default but a variety of hardware configurations it turns out that this caused a regression.

* PPC64LE hardware does not support ASPM at a hardware level. CONFIG_PCIEASPM is often disabled on these architectures.
* Some dGPUs on ALD platforms don't work with ASPM enabled and PCIe subsystem disables it

Check with the PCIe subsystem to see that ASPM has been enabled or not.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3 -0
index 5acd0473ed01..d2548fab51c5 100644
@@ -2008,6 +2008,9 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 			return -ENODEV;
 	}
 
+	if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
+		amdgpu_aspm = 0;
+
 	if (amdgpu_virtual_display ||
 	    amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
 		supports_atomic = true;
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Mario Limonciello

commit 0064b0ce85bb ("drm/amd/pm: enable ASPM by default") enabled ASPM by default but a variety of hardware configurations it turns out that this caused a regression.

* PPC64LE hardware does not support ASPM at a hardware level. CONFIG_PCIEASPM is often disabled on these architectures.
* Some dGPUs on ALD platforms don't work with ASPM enabled and PCIe subsystem disables it

Check with the PCIe subsystem to see that ASPM has been enabled or not.

Quoted 8 lines
Quoted 21 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3 -1
index 5acd0473ed01..d2548fab51c5 100644
@@ -2008,6 +2008,9 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
                        return -ENODEV;
        }
 
+       if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
+               amdgpu_aspm = 0;
+
        if (amdgpu_virtual_display ||
            amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
                supports_atomic = true;
--

2.25.1

#2 lore raw
In reply to Mario Limonciello
Quoted 29 lines · Mario Limonciello

commit 0064b0ce85bb ("drm/amd/pm: enable ASPM by default") enabled ASPM by default but a variety of hardware configurations it turns out that this caused a regression.

* PPC64LE hardware does not support ASPM at a hardware level. CONFIG_PCIEASPM is often disabled on these architectures.
* Some dGPUs on ALD platforms don't work with ASPM enabled and PCIe subsystem disables it

Check with the PCIe subsystem to see that ASPM has been enabled or not.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index 5acd0473ed01..d2548fab51c5 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c static int amdgpu_pci_probe(struct pci_dev *pdev, · line 2013

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3 -0
@@ -2008,6 +2008,9 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
  			return -ENODEV;
  	}
 
+	if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
+		amdgpu_aspm = 0;
+

Doesn't this disable aspm for all devices even though only one of the bridges doesn't have support?

Thanks,
Lijo

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
  	if (amdgpu_virtual_display ||
  	    amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
  		supports_atomic = true;
#3 lore raw

[AMD Official Use Only]

Quoted 37 lines
Quoted 1 line

commit 0064b0ce85bb ("drm/amd/pm: enable ASPM by default") enabled

ASPM

Quoted 8 lines

by default but a variety of hardware configurations it turns out that this caused a regression.

* PPC64LE hardware does not support ASPM at a hardware level. CONFIG_PCIEASPM is often disabled on these architectures.
* Some dGPUs on ALD platforms don't work with ASPM enabled and PCIe subsystem disables it

Quoted 5 lines

Check with the PCIe subsystem to see that ASPM has been enabled or not.

Fixes 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")

Link:

https://wiki.raptorcs.com/w/images/a/ad/P9_PHB_version1.0_27July2018_p
ub.pdf

Review

Quoted 11 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +++
  1 file changed, 3 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c static int amdgpu_pci_probe(struct pci_dev

Quoted 4 lines

index 5acd0473ed01..d2548fab51c5 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
@@ -2008,6 +2008,9 @@ static int amdgpu_pci_probe(struct pci_dev

*pdev,

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
  			return -ENODEV;
  	}
 
Quoted 6 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c static int amdgpu_pci_probe(struct pci_dev *pdev, · line 2013

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3 -0
+	if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
+		amdgpu_aspm = 0;
+

Doesn't this disable aspm for all devices even though only one of the bridges doesn't have support?

At least with how it's a global parameter today I don't think we can do much better without a refactor.

As it's actively breaking people I think I would prefer to get this in as it is now (which can go to stable trees too), and then do the refactor as a follow up.

Quoted 8 lines

Thanks,
Lijo

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
  	if (amdgpu_virtual_display ||
  	    amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
  		supports_atomic = true;
#4 lore raw
Quoted 46 lines · Mario

[AMD Official Use Only]

Quoted 37 lines
Quoted 1 line

commit 0064b0ce85bb ("drm/amd/pm: enable ASPM by default") enabled

ASPM

Quoted 8 lines

by default but a variety of hardware configurations it turns out that this caused a regression.

* PPC64LE hardware does not support ASPM at a hardware level. CONFIG_PCIEASPM is often disabled on these architectures.
* Some dGPUs on ALD platforms don't work with ASPM enabled and PCIe subsystem disables it

Quoted 5 lines

Check with the PCIe subsystem to see that ASPM has been enabled or not.

Fixes 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")

Link:

https://wiki.raptorcs.com/w/images/a/ad/P9_PHB_version1.0_27July2018_p
ub.pdf

Review

Quoted 11 lines
---
   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +++
   1 file changed, 3 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c static int amdgpu_pci_probe(struct pci_dev

Quoted 4 lines

index 5acd0473ed01..d2548fab51c5 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
@@ -2008,6 +2008,9 @@ static int amdgpu_pci_probe(struct pci_dev

*pdev,

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
   			return -ENODEV;
   	}
 
Quoted 6 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c static int amdgpu_pci_probe(struct pci_dev *pdev, · line 2013

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3 -0
+	if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
+		amdgpu_aspm = 0;
+

Doesn't this disable aspm for all devices even though only one of the bridges doesn't have support?

Quoted 7 lines

At least with how it's a global parameter today I don't think we can do much better without a refactor.

As it's actively breaking people I think I would prefer to get this in as it is now (which can go to stable trees too), and then do the refactor as a follow up.

There is enable_aspm/program_aspm calls and the check could be in one of those places. I agree that for now this is the easier path.

Thanks,
Lijo

Quoted 8 lines
Quoted 8 lines

Thanks,
Lijo

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
   	if (amdgpu_virtual_display ||
   	    amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
   		supports_atomic = true;