Skip to contentSkip to conversation

drm/amdgpu: disable ASPM for legacy products that don't support ASPM

PATCH In review Richard Gong 3 participants 8 messages Apr 8, 2022

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

PATCH 1/1 drm/amdgpu: disable ASPM for legacy products that don't support ASPM

Active State Power Management (ASPM) feature is enabled since kernel 5.14. However there are some legacy products (WX3200 and RX640 are examples) that do not support ASPM. Use them as video/display output and system would hang during suspend/resume.

Add extra check to disable ASPM for old products that don't have ASPM support.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -0
index bb1c025d9001..8987107f41ee 100644
@@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 	if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
 		amdgpu_aspm = 0;
 
+	/* disable ASPM for the legacy products that don't support ASPM */
+	if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
+		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
#1 lore raw

[Public]

Quoted 35 lines

-----Original Message-----
From: Gong, Richard <[email protected]>
Sent: Friday, April 8, 2022 10:45
To: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; linux- [email protected]; Limonciello, Mario <[email protected]>; Gong, Richard <[email protected]>
Subject: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM

Active State Power Management (ASPM) feature is enabled since kernel 5.14.
However there are some legacy products (WX3200 and RX640 are examples) that
do not support ASPM. Use them as video/display output and system would hang
during suspend/resume.

Add extra check to disable ASPM for old products that don't have ASPM support.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index bb1c025d9001..8987107f41ee 100644

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

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -0
@@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev
 *pdev,
 	if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
 		amdgpu_aspm = 0;
 
+	/* disable ASPM for the legacy products that don't support ASPM */
+	if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
+		amdgpu_aspm = 0;
+

I think it's problematic to disable it for the entire driver. There might be multiple AMDGPUs in the system, and others may support ASPM.

Can it be done just as part of probe for Polaris?

Quoted 5 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;
--
2.25.1

#2 lore raw
Quoted 27 lines · Mario

[Public]

Quoted 22 lines

-----Original Message-----
From: Gong, Richard <[email protected]>
Sent: Friday, April 8, 2022 10:45
To: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; linux- [email protected]; Limonciello, Mario <[email protected]>; Gong, Richard <[email protected]>
Subject: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM

Active State Power Management (ASPM) feature is enabled since kernel 5.14.
However there are some legacy products (WX3200 and RX640 are examples) that
do not support ASPM. Use them as video/display output and system would hang
during suspend/resume.

Add extra check to disable ASPM for old products that don't have ASPM support.

The patch description is incorrect. ASPM works just fine on these GPUs. It's more of an issue with whether the underlying platform supports ASPM or not. Rather than disabling a chip family, I would prefer to add a check for problematic platforms and disable ASPM on those platforms.

Alex

Quoted 32 lines
Quoted 13 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index bb1c025d9001..8987107f41ee 100644

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

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -0
@@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev
 *pdev,
      if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
              amdgpu_aspm = 0;
 
+     /* disable ASPM for the legacy products that don't support ASPM */
+     if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
+             amdgpu_aspm = 0;
+

I think it's problematic to disable it for the entire driver. There might be multiple AMDGPUs in the system, and others may support ASPM.

Can it be done just as part of probe for Polaris?

Quoted 5 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;

--
2.25.1

#3 lore raw
Quoted 28 lines · Alex Deucher
Quoted 25 lines · Mario

[Public]

Quoted 20 lines

-----Original Message-----
From: Gong, Richard <[email protected]>
Sent: Friday, April 8, 2022 10:45
To: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; linux- [email protected]; Limonciello, Mario <[email protected]>; Gong, Richard <[email protected]>
Subject: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM

Active State Power Management (ASPM) feature is enabled since kernel 5.14.
However there are some legacy products (WX3200 and RX640 are examples) that
do not support ASPM. Use them as video/display output and system would hang
during suspend/resume.

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

Add extra check to disable ASPM for old products that don't have ASPM support.

The patch description is incorrect. ASPM works just fine on these GPUs. It's more of an issue with whether the underlying platform supports ASPM or not. Rather than disabling a chip family, I would prefer to add a check for problematic platforms and disable ASPM on those platforms.

For example, see intel_core_rkl_chk() in smu7_hwmgr.c. We disable PCIe DPM on RKL platforms due to compatibility issues with that particular platform.

Alex

Quoted 35 lines

Alex

Quoted 32 lines
Quoted 13 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index bb1c025d9001..8987107f41ee 100644

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

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -0
@@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev
 *pdev,
      if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
              amdgpu_aspm = 0;
 
+     /* disable ASPM for the legacy products that don't support ASPM */
+     if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
+             amdgpu_aspm = 0;
+

I think it's problematic to disable it for the entire driver. There might be multiple AMDGPUs in the system, and others may support ASPM.

Can it be done just as part of probe for Polaris?

Quoted 5 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;

--
2.25.1

#4 lore raw
In reply to Alex Deucher

Hi Alex,

Quoted 26 lines · Alex Deucher
Quoted 24 lines · Mario

[Public]

Quoted 20 lines

-----Original Message-----
From: Gong, Richard <[email protected]>
Sent: Friday, April 8, 2022 10:45
To: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; linux- [email protected]; Limonciello, Mario <[email protected]>; Gong, Richard <[email protected]>
Subject: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM

Active State Power Management (ASPM) feature is enabled since kernel 5.14.
However there are some legacy products (WX3200 and RX640 are examples) that
do not support ASPM. Use them as video/display output and system would hang
during suspend/resume.

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

Add extra check to disable ASPM for old products that don't have ASPM support.

The patch description is incorrect. ASPM works just fine on these GPUs. It's more of an issue with whether the underlying platform supports ASPM or not. Rather than disabling a chip family, I would prefer to add a check for problematic platforms and disable ASPM on those platforms.

I thought that initially.

But I found out that suspend/resume works just fine on the "problematic" platform (Dell Precision 3660, Intel ADL based) + AMD W6400 GFX card. With WX3200 or RX640, suspend/resume works only when ASPM was disabled. Both WX3200 and RX640 are from CHIP_POLARIS12 family.

This is why I take chip family approach.

Regards,

Richard

Quoted 32 lines

Alex

Quoted 30 lines
Quoted 12 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index bb1c025d9001..8987107f41ee 100644

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

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -0
@@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev
 *pdev,
       if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
               amdgpu_aspm = 0;
 
+     /* disable ASPM for the legacy products that don't support ASPM */
+     if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
+             amdgpu_aspm = 0;
+

I think it's problematic to disable it for the entire driver. There might be multiple AMDGPUs in the system, and others may support ASPM.

Can it be done just as part of probe for Polaris?

Quoted 5 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;

--
2.25.1

#5 lore raw
Quoted 38 lines · Richard

Hi Alex,

Quoted 26 lines · Alex Deucher
Quoted 24 lines · Mario

[Public]

Quoted 20 lines

-----Original Message-----
From: Gong, Richard <[email protected]>
Sent: Friday, April 8, 2022 10:45
To: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; linux- [email protected]; Limonciello, Mario <[email protected]>; Gong, Richard <[email protected]>
Subject: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM

Active State Power Management (ASPM) feature is enabled since kernel 5.14.
However there are some legacy products (WX3200 and RX640 are examples) that
do not support ASPM. Use them as video/display output and system would hang
during suspend/resume.

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

Add extra check to disable ASPM for old products that don't have ASPM support.

The patch description is incorrect. ASPM works just fine on these GPUs. It's more of an issue with whether the underlying platform supports ASPM or not. Rather than disabling a chip family, I would prefer to add a check for problematic platforms and disable ASPM on those platforms.

Quoted 8 lines

I thought that initially.

But I found out that suspend/resume works just fine on the "problematic" platform (Dell Precision 3660, Intel ADL based) + AMD W6400 GFX card. With WX3200 or RX640, suspend/resume works only when ASPM was disabled. Both WX3200 and RX640 are from CHIP_POLARIS12 family.

This is why I take chip family approach.

Sure, but you could put those polaris12 boards into a different system and they work just fine with ASPM enabled.

Alex

Quoted 37 lines

Regards,

Richard

Quoted 32 lines

Alex

Quoted 30 lines
Quoted 12 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index bb1c025d9001..8987107f41ee 100644

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

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -0
@@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev
 *pdev,
       if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
               amdgpu_aspm = 0;
 
+     /* disable ASPM for the legacy products that don't support ASPM */
+     if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
+             amdgpu_aspm = 0;
+

I think it's problematic to disable it for the entire driver. There might be multiple AMDGPUs in the system, and others may support ASPM.

Can it be done just as part of probe for Polaris?

Quoted 5 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;

--
2.25.1

#6 lore raw
In reply to Limonciello, Mario
Quoted 43 lines · Mario

[Public]

Quoted 39 lines

-----Original Message-----
From: Gong, Richard <[email protected]>
Sent: Friday, April 8, 2022 10:45
To: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; linux- [email protected]; Limonciello, Mario <[email protected]>; Gong, Richard <[email protected]>
Subject: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM

Active State Power Management (ASPM) feature is enabled since kernel 5.14.
However there are some legacy products (WX3200 and RX640 are examples) that
do not support ASPM. Use them as video/display output and system would hang
during suspend/resume.

Add extra check to disable ASPM for old products that don't have ASPM support.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index bb1c025d9001..8987107f41ee 100644
@@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev
 *pdev,
  	if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
  		amdgpu_aspm = 0;
 
Quoted 6 lines

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

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -0
+	/* disable ASPM for the legacy products that don't support ASPM */
+	if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
+		amdgpu_aspm = 0;
+

I think it's problematic to disable it for the entire driver. There might be multiple AMDGPUs in the system, and others may support ASPM.

The "problem" are WX3200 and RX640, both are from the same POLARIS12 family.

Quoted 7 lines

Can it be done just as part of probe for Polaris?

Quoted 5 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;
--
2.25.1

#7 lore raw

[Public]

Quoted 68 lines

-----Original Message-----
From: Gong, Richard <[email protected]>
Sent: Friday, April 8, 2022 11:20
To: Limonciello, Mario <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; linux- [email protected]
Subject: Re: [PATCH] drm/amdgpu: disable ASPM for legacy products that don't support ASPM

Quoted 8 lines · Mario

[Public]

Quoted 4 lines

-----Original Message-----
From: Gong, Richard <[email protected]>
Sent: Friday, April 8, 2022 10:45
To: Deucher, Alexander <[email protected]>; Koenig,

Christian

Quoted 3 lines
Quoted 3 lines

<[email protected]>; Pan, Xinhui <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected];

linux-

Quoted 1 line
Quoted 1 line

[email protected]; Limonciello, Mario

<[email protected]>;

Quoted 2 lines
Quoted 2 lines

Gong, Richard <[email protected]>
Subject: [PATCH] drm/amdgpu: disable ASPM for legacy products that

don't

Quoted 5 lines
Quoted 5 lines

support ASPM

Active State Power Management (ASPM) feature is enabled since kernel 5.14.
However there are some legacy products (WX3200 and RX640 are

examples)

Quoted 2 lines
Quoted 2 lines

that
do not support ASPM. Use them as video/display output and system

would

Quoted 22 lines
Quoted 22 lines

hang
during suspend/resume.

Add extra check to disable ASPM for old products that don't have ASPM support.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
index bb1c025d9001..8987107f41ee 100644
@@ -2012,6 +2012,10 @@ static int amdgpu_pci_probe(struct pci_dev
 *pdev,
  	if (amdgpu_aspm == -1 && !pcie_aspm_enabled(pdev))
  		amdgpu_aspm = 0;
 
Quoted 5 lines

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

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -0
+	/* disable ASPM for the legacy products that don't support ASPM */
+	if ((flags & AMD_ASIC_MASK) == CHIP_POLARIS12)
+		amdgpu_aspm = 0;
+

I think it's problematic to disable it for the entire driver. There might be

Quoted 6 lines

multiple

Quoted 1 line

AMDGPUs in the system, and others may support ASPM.

The "problem" are WX3200 and RX640, both are from the same POLARIS12 family.

Right but what if some other "working" cards are included in the system too? Then ASPM gets disabled for them too. It should only be disabled for the pci_dev corresponding to problematic GPUs in problematic situations.

Quoted 7 lines
Quoted 7 lines

Can it be done just as part of probe for Polaris?

Quoted 5 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;
--
2.25.1