Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 5.15 v2 1/2] drm/amd: Move helper for dynamic speed switch check out of smu13
@ 2023-10-31 16:04 Mario Limonciello
  2023-10-31 16:04 ` [PATCH 5.15 v2 2/2] drm/amd: Disable ASPM for VI w/ all Intel systems Mario Limonciello
  2023-11-06 11:30 ` [PATCH 5.15 v2 1/2] drm/amd: Move helper for dynamic speed switch check out of smu13 Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Mario Limonciello @ 2023-10-31 16:04 UTC (permalink / raw)
  To: stable; +Cc: Mario Limonciello, Evan Quan, Alex Deucher

This helper is used for checking if the connected host supports
the feature, it can be moved into generic code to be used by other
smu implementations as well.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 188623076d0f1a500583d392b6187056bf7cc71a)

The original problematic dGPU is not supported in 5.15.

Just introduce new function for 5.15 as a dependency for fixing
unrelated dGPU that uses this symbol as well.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v1->v2:
 * Update commit to 6.5-rc2 commit.
   It merged as both of these:
   188623076d0f1a500583d392b6187056bf7cc71a
   5d1eb4c4c872b55664f5754cc16827beff8630a7
   It's already been backported into 6.1.y as well.
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index d90da384d185..1f1e7966beb5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1285,6 +1285,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
 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_pcie_dynamic_switching_supported(void);
 bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev);
 bool amdgpu_device_aspm_support_quirk(void);
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 2cf49a32ac6c..f57334fff7fc 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1319,6 +1319,25 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev)
 	return true;
 }
 
+/*
+ * Intel hosts such as Raptor Lake and Sapphire Rapids don't support dynamic
+ * speed switching. Until we have confirmation from Intel that a specific host
+ * supports it, it's safer that we keep it disabled for all.
+ *
+ * https://edc.intel.com/content/www/us/en/design/products/platforms/details/raptor-lake-s/13th-generation-core-processors-datasheet-volume-1-of-2/005/pci-express-support/
+ * https://gitlab.freedesktop.org/drm/amd/-/issues/2663
+ */
+bool amdgpu_device_pcie_dynamic_switching_supported(void)
+{
+#if IS_ENABLED(CONFIG_X86)
+	struct cpuinfo_x86 *c = &cpu_data(0);
+
+	if (c->x86_vendor == X86_VENDOR_INTEL)
+		return false;
+#endif
+	return true;
+}
+
 /**
  * amdgpu_device_should_use_aspm - check if the device should program ASPM
  *
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 5.15 v2 2/2] drm/amd: Disable ASPM for VI w/ all Intel systems
  2023-10-31 16:04 [PATCH 5.15 v2 1/2] drm/amd: Move helper for dynamic speed switch check out of smu13 Mario Limonciello
@ 2023-10-31 16:04 ` Mario Limonciello
  2023-11-06 11:30 ` [PATCH 5.15 v2 1/2] drm/amd: Move helper for dynamic speed switch check out of smu13 Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Mario Limonciello @ 2023-10-31 16:04 UTC (permalink / raw)
  To: stable; +Cc: Mario Limonciello, Paolo Gentili, Alex Deucher

Originally we were quirking ASPM disabled specifically for VI when
used with Alder Lake, but it appears to have problems with Rocket
Lake as well.

Like we've done in the case of dpm for newer platforms, disable
ASPM for all Intel systems.

Cc: stable@vger.kernel.org # 5.15+
Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")
Reported-and-tested-by: Paolo Gentili <paolo.gentili@canonical.com>
Closes: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2036742
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry-picked from 64ffd2f1d00c6235dabe9704bbb0d9ce3e28147f)
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/vi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index b9555ba6d32f..6d64d603a97a 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -1147,7 +1147,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) || !amdgpu_device_pcie_dynamic_switching_supported())
 		return;
 
 	if (adev->flags & AMD_IS_APU ||
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 5.15 v2 1/2] drm/amd: Move helper for dynamic speed switch check out of smu13
  2023-10-31 16:04 [PATCH 5.15 v2 1/2] drm/amd: Move helper for dynamic speed switch check out of smu13 Mario Limonciello
  2023-10-31 16:04 ` [PATCH 5.15 v2 2/2] drm/amd: Disable ASPM for VI w/ all Intel systems Mario Limonciello
@ 2023-11-06 11:30 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2023-11-06 11:30 UTC (permalink / raw)
  To: Mario Limonciello; +Cc: stable, Evan Quan, Alex Deucher

On Tue, Oct 31, 2023 at 11:04:50AM -0500, Mario Limonciello wrote:
> This helper is used for checking if the connected host supports
> the feature, it can be moved into generic code to be used by other
> smu implementations as well.
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> Reviewed-by: Evan Quan <evan.quan@amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> (cherry picked from commit 188623076d0f1a500583d392b6187056bf7cc71a)
> 
> The original problematic dGPU is not supported in 5.15.
> 
> Just introduce new function for 5.15 as a dependency for fixing
> unrelated dGPU that uses this symbol as well.
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>

Both now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-11-06 11:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-31 16:04 [PATCH 5.15 v2 1/2] drm/amd: Move helper for dynamic speed switch check out of smu13 Mario Limonciello
2023-10-31 16:04 ` [PATCH 5.15 v2 2/2] drm/amd: Disable ASPM for VI w/ all Intel systems Mario Limonciello
2023-11-06 11:30 ` [PATCH 5.15 v2 1/2] drm/amd: Move helper for dynamic speed switch check out of smu13 Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox