Skip to contentSkip to conversation

drm/amd: Extend Intel ASPM quirk to all dGPUs

RFC In review Mario Limonciello 3 participants 5 messages Jul 5, 2023 – Jul 6, 2023

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

RFC 1/2 drm/amd: Extend Intel ASPM quirk to all dGPUs

More failures are reported across additional products and so it seems unless we have a handle on the fundmental ASPM incompatibilities with Intel host and AMD dGPU, we should not allow them on problematic hosts.

Fixes 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 39 +++++++++++++++-------
 drivers/gpu/drm/amd/amdgpu/nv.c            |  2 +-
 drivers/gpu/drm/amd/amdgpu/vi.c            |  2 +-
 4 files changed, 29 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0 -1
index dc4dc1446a19..294a549e7499 100644
@@ -1314,7 +1314,6 @@ void amdgpu_device_pci_config_reset(struct amdgpu_device *adev);
 int amdgpu_device_pci_reset(struct amdgpu_device *adev);
 bool amdgpu_device_need_post(struct amdgpu_device *adev);
 bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev);
-bool amdgpu_device_aspm_support_quirk(void);
 
 void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes,
 				  u64 num_vis_bytes);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +27 -12
index 7f069e1731fe..ef22a0a6065e 100644
@@ -1458,6 +1458,30 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev)
 	return true;
 }
 
+static bool amdgpu_device_aspm_support_quirk(void)
+{
+#if IS_ENABLED(CONFIG_X86)
+	struct cpuinfo_x86 *c = &cpu_data(0);
+
+	if (c->x86 != 6)
+		return true;
+
+	switch (c->x86_model) {
+	/* Problems reported for Alder Lake
+	 * Volcanic Islands:
+	 *   https://gitlab.freedesktop.org/drm/amd/-/issues/1885
+	 *   e02fe3bc7aba2 ("drm/amdgpu: vi: disable ASPM on Intel Alder Lake based systems")
+	 * Navi 1x cards:
+	 *   https://gitlab.freedesktop.org/drm/amd/-/issues/2458
+	 *   c08c079692da0 ("drm/amdgpu/nv: Apply ASPM quirk on Intel ADL + AMD Navi")
+	 */
+	case INTEL_FAM6_ALDERLAKE:
+		return false;
+	}
+#endif
+	return true;
+}
+
 /**
  * amdgpu_device_should_use_aspm - check if the device should program ASPM
  *
@@ -1480,18 +1504,9 @@ bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev)
 	default:
 		return false;
 	}
-	return pcie_aspm_enabled(adev->pdev);
-}
-
-bool amdgpu_device_aspm_support_quirk(void)
-{
-#if IS_ENABLED(CONFIG_X86)
-	struct cpuinfo_x86 *c = &cpu_data(0);
-
-	return !(c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
-#else
-	return true;
-#endif
+	if (!pcie_aspm_enabled(adev->pdev))
+		return false;
+	return amdgpu_device_aspm_support_quirk();
 }
 
 /* if we get transitioned to only one device, take VGA back */
drivers/gpu/drm/amd/amdgpu/nv.c +1 -1
index 51523b27a186..4f8e696d9ba2 100644
@@ -527,7 +527,7 @@ static int nv_set_vce_clocks(struct amdgpu_device *adev, u32 evclk, u32 ecclk)
 
 static void nv_program_aspm(struct amdgpu_device *adev)
 {
-	if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_aspm_support_quirk())
+	if (!amdgpu_device_should_use_aspm(adev))
 		return;
 
 	if (!(adev->flags & AMD_IS_APU) &&
drivers/gpu/drm/amd/amdgpu/vi.c +1 -1
index 6a8494f98d3e..c413cac369e4 100644
@@ -1124,7 +1124,7 @@ static void vi_program_aspm(struct amdgpu_device *adev)
 	bool bL1SS = false;
 	bool bClkReqSupport = true;
 
-	if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_aspm_support_quirk())
+	if (!amdgpu_device_should_use_aspm(adev))
 		return;
 
 	if (adev->flags & AMD_IS_APU ||
Signature · 1 line
2.34.1
#1 lore raw

RFC 2/2 drm/amd: Extend ASPM disablement for Intel Sapphire rapids host + AMD dGPU

Sapphire rapids is reported to have problems with Navi3x dGPUs where the screen freezes and the following message is in the logs:

```
[CRTC:56:crtc-0] flip_done timed out
```

These issues go away when ASPM has been disabled. Extend the disablement for Sapphire Rapids.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -0
index ef22a0a6065e..e9206993c743 100644
@@ -1476,6 +1476,11 @@ static bool amdgpu_device_aspm_support_quirk(void)
 	 *   c08c079692da0 ("drm/amdgpu/nv: Apply ASPM quirk on Intel ADL + AMD Navi")
 	 */
 	case INTEL_FAM6_ALDERLAKE:
+	/* Problems reported for Sapphire Rapids
+	 * Navi 3x:
+	 *   https://gitlab.freedesktop.org/drm/amd/-/issues/2663
+	 */
+	case INTEL_FAM6_SAPPHIRERAPIDS_X:
 		return false;
 	}
 #endif
Signature · 1 line
2.34.1
Acked-by on v1 2/2
#2 lore raw

Re: [RFC 2/2] drm/amd: Extend ASPM disablement for Intel Sapphire rapids host + AMD dGPU

Quoted 7 lines · Mario Limonciello

Sapphire rapids is reported to have problems with Navi3x dGPUs where the screen freezes and the following message is in the logs:

```
[CRTC:56:crtc-0] flip_done timed out
```
Quoted 6 lines

These issues go away when ASPM has been disabled. Extend the disablement for Sapphire Rapids.

Series is:

Quoted 23 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -1
index ef22a0a6065e..e9206993c743 100644
@@ -1476,6 +1476,11 @@ static bool amdgpu_device_aspm_support_quirk(void)
         *   c08c079692da0 ("drm/amdgpu/nv: Apply ASPM quirk on Intel ADL + AMD Navi")
         */
        case INTEL_FAM6_ALDERLAKE:
+       /* Problems reported for Sapphire Rapids
+        * Navi 3x:
+        *   https://gitlab.freedesktop.org/drm/amd/-/issues/2663
+        */
+       case INTEL_FAM6_SAPPHIRERAPIDS_X:
                return false;
        }
 #endif
--

2.34.1

#3 lore raw
In reply to Mario Limonciello

[AMD Official Use Only - General]

One small nitpick:
It seems there is missing a default clause for the switch statement.
Will that hit the compile warning about "a switch statement must have a default clause"? With that checked, the series is reviewed-by: Evan Quan <[email protected]>

Evan

Quoted 135 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Mario Limonciello
Sent: Thursday, July 6, 2023 2:07 AM
To: [email protected]
Cc: [email protected]; Limonciello, Mario <[email protected]>
Subject: [RFC 1/2] drm/amd: Extend Intel ASPM quirk to all dGPUs

More failures are reported across additional products and so it seems unless we have a handle on the fundmental ASPM incompatibilities with Intel host and AMD dGPU, we should not allow them on problematic hosts.

Fixes 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 39 +++++++++++++++---
----
 drivers/gpu/drm/amd/amdgpu/nv.c            |  2 +-
 drivers/gpu/drm/amd/amdgpu/vi.c            |  2 +-
 4 files changed, 29 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0 -1
index dc4dc1446a19..294a549e7499 100644
@@ -1314,7 +1314,6 @@ void amdgpu_device_pci_config_reset(struct
 amdgpu_device *adev);
 int amdgpu_device_pci_reset(struct amdgpu_device *adev);
 bool amdgpu_device_need_post(struct amdgpu_device *adev);
 bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev);
-bool amdgpu_device_aspm_support_quirk(void);
 
 void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64

num_bytes,

                                u64 num_vis_bytes);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +24 -0
index 7f069e1731fe..ef22a0a6065e 100644
@@ -1458,6 +1458,30 @@ bool amdgpu_device_need_post(struct
 amdgpu_device *adev)
      return true;
 }
 
+static bool amdgpu_device_aspm_support_quirk(void)
+{
+#if IS_ENABLED(CONFIG_X86)
+     struct cpuinfo_x86 *c = &cpu_data(0);
+
+     if (c->x86 != 6)
+             return true;
+
+     switch (c->x86_model) {
+     /* Problems reported for Alder Lake
+      * Volcanic Islands:
+      *   https://gitlab.freedesktop.org/drm/amd/-/issues/1885
+      *   e02fe3bc7aba2 ("drm/amdgpu: vi: disable ASPM on Intel Alder
 Lake based systems")
+      * Navi 1x cards:
+      *   https://gitlab.freedesktop.org/drm/amd/-/issues/2458
+      *   c08c079692da0 ("drm/amdgpu/nv: Apply ASPM quirk on Intel
 ADL + AMD Navi")
+      */
+     case INTEL_FAM6_ALDERLAKE:
+             return false;
+     }
+#endif
+     return true;
+}
+

/**
* amdgpu_device_should_use_aspm - check if the device should program
ASPM
*

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -12
@@ -1480,18 +1504,9 @@ bool amdgpu_device_should_use_aspm(struct
 amdgpu_device *adev)
      default:
              return false;
      }
-     return pcie_aspm_enabled(adev->pdev);
-}
-
-bool amdgpu_device_aspm_support_quirk(void)
-{
-#if IS_ENABLED(CONFIG_X86)
-     struct cpuinfo_x86 *c = &cpu_data(0);
-
-     return !(c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
-#else
-     return true;
-#endif
+     if (!pcie_aspm_enabled(adev->pdev))
+             return false;
+     return amdgpu_device_aspm_support_quirk();
 }
 

/* if we get transitioned to only one device, take VGA back */

drivers/gpu/drm/amd/amdgpu/nv.c +1 -1
index 51523b27a186..4f8e696d9ba2 100644
@@ -527,7 +527,7 @@ static int nv_set_vce_clocks(struct amdgpu_device
 *adev, u32 evclk, u32 ecclk)
 
 static void nv_program_aspm(struct amdgpu_device *adev)
 {
-     if (!amdgpu_device_should_use_aspm(adev)
 || !amdgpu_device_aspm_support_quirk())
+     if (!amdgpu_device_should_use_aspm(adev))
              return;
      if (!(adev->flags & AMD_IS_APU) &&
drivers/gpu/drm/amd/amdgpu/vi.c +1 -1
index 6a8494f98d3e..c413cac369e4 100644
@@ -1124,7 +1124,7 @@ static void vi_program_aspm(struct
 amdgpu_device *adev)
      bool bL1SS = false;
      bool bClkReqSupport = true;
 
-     if (!amdgpu_device_should_use_aspm(adev)
 || !amdgpu_device_aspm_support_quirk())
+     if (!amdgpu_device_should_use_aspm(adev))
              return;
      if (adev->flags & AMD_IS_APU ||

--
2.34.1

#4 lore raw

[AMD Official Use Only - General]

Thanks. I'm going to leave this series as the backup option, have another idea that I'll have Koba try first.

Quoted 157 lines

-----Original Message-----
From: Quan, Evan <[email protected]>
Sent: Wednesday, July 5, 2023 20:04
To: Limonciello, Mario <[email protected]>; amd- [email protected]
Cc: [email protected]; Limonciello, Mario <[email protected]>
Subject: RE: [RFC 1/2] drm/amd: Extend Intel ASPM quirk to all dGPUs

[AMD Official Use Only - General]

One small nitpick:
It seems there is missing a default clause for the switch statement. Will that hit the compile warning about "a switch statement must have a default clause"?
With that checked, the series is reviewed-by: Evan Quan <[email protected]>

Evan

Quoted 2 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of

Mario

Quoted 11 lines

Limonciello
Sent: Thursday, July 6, 2023 2:07 AM
To: [email protected]
Cc: [email protected]; Limonciello, Mario <[email protected]>
Subject: [RFC 1/2] drm/amd: Extend Intel ASPM quirk to all dGPUs

More failures are reported across additional products and so it seems unless we have a handle on the fundmental ASPM incompatibilities with Intel host and AMD dGPU, we should not allow them on problematic hosts.

Quoted 5 lines
Fixes 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 39 +++++++++++++++-

--

Quoted 117 lines

----

 drivers/gpu/drm/amd/amdgpu/nv.c            |  2 +-
 drivers/gpu/drm/amd/amdgpu/vi.c            |  2 +-
 4 files changed, 29 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0 -1
index dc4dc1446a19..294a549e7499 100644
@@ -1314,7 +1314,6 @@ void amdgpu_device_pci_config_reset(struct
 amdgpu_device *adev);
 int amdgpu_device_pci_reset(struct amdgpu_device *adev);
 bool amdgpu_device_need_post(struct amdgpu_device *adev);
 bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev);
-bool amdgpu_device_aspm_support_quirk(void);
 
 void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64

num_bytes,

                                u64 num_vis_bytes);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +24 -0
index 7f069e1731fe..ef22a0a6065e 100644
@@ -1458,6 +1458,30 @@ bool amdgpu_device_need_post(struct
 amdgpu_device *adev)
      return true;
 }
 
+static bool amdgpu_device_aspm_support_quirk(void)
+{
+#if IS_ENABLED(CONFIG_X86)
+     struct cpuinfo_x86 *c = &cpu_data(0);
+
+     if (c->x86 != 6)
+             return true;
+
+     switch (c->x86_model) {
+     /* Problems reported for Alder Lake
+      * Volcanic Islands:
+      *   https://gitlab.freedesktop.org/drm/amd/-/issues/1885
+      *   e02fe3bc7aba2 ("drm/amdgpu: vi: disable ASPM on Intel Alder
 Lake based systems")
+      * Navi 1x cards:
+      *   https://gitlab.freedesktop.org/drm/amd/-/issues/2458
+      *   c08c079692da0 ("drm/amdgpu/nv: Apply ASPM quirk on Intel
 ADL + AMD Navi")
+      */
+     case INTEL_FAM6_ALDERLAKE:
+             return false;
+     }
+#endif
+     return true;
+}
+

/**
* amdgpu_device_should_use_aspm - check if the device should program
ASPM
*

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -12
@@ -1480,18 +1504,9 @@ bool amdgpu_device_should_use_aspm(struct
 amdgpu_device *adev)
      default:
              return false;
      }
-     return pcie_aspm_enabled(adev->pdev);
-}
-
-bool amdgpu_device_aspm_support_quirk(void)
-{
-#if IS_ENABLED(CONFIG_X86)
-     struct cpuinfo_x86 *c = &cpu_data(0);
-
-     return !(c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
-#else
-     return true;
-#endif
+     if (!pcie_aspm_enabled(adev->pdev))
+             return false;
+     return amdgpu_device_aspm_support_quirk();
 }
 

/* if we get transitioned to only one device, take VGA back */

drivers/gpu/drm/amd/amdgpu/nv.c +1 -1
index 51523b27a186..4f8e696d9ba2 100644
@@ -527,7 +527,7 @@ static int nv_set_vce_clocks(struct amdgpu_device
 *adev, u32 evclk, u32 ecclk)
 
 static void nv_program_aspm(struct amdgpu_device *adev)
 {
-     if (!amdgpu_device_should_use_aspm(adev)
 || !amdgpu_device_aspm_support_quirk())
+     if (!amdgpu_device_should_use_aspm(adev))
              return;
      if (!(adev->flags & AMD_IS_APU) &&
drivers/gpu/drm/amd/amdgpu/vi.c +1 -1
index 6a8494f98d3e..c413cac369e4 100644
@@ -1124,7 +1124,7 @@ static void vi_program_aspm(struct
 amdgpu_device *adev)
      bool bL1SS = false;
      bool bClkReqSupport = true;
 
-     if (!amdgpu_device_should_use_aspm(adev)
 || !amdgpu_device_aspm_support_quirk())
+     if (!amdgpu_device_should_use_aspm(adev))
              return;
      if (adev->flags & AMD_IS_APU ||

--
2.34.1