public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5.15 1/2] drm/amd: Move helper for dynamic speed switch check out of smu13
@ 2023-10-27  8:39 Mario Limonciello
  2023-10-27  8:39 ` [PATCH 5.15 2/2] drm/amd: Disable ASPM for VI w/ all Intel systems Mario Limonciello
  2023-10-31 11:50 ` [PATCH 5.15 1/2] drm/amd: Move helper for dynamic speed switch check out of smu13 Greg KH
  0 siblings, 2 replies; 8+ messages in thread
From: Mario Limonciello @ 2023-10-27  8:39 UTC (permalink / raw)
  To: stable; +Cc: Mario Limonciello

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 5d1eb4c4c872b55664f5754cc16827beff8630a7)

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>
---
 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] 8+ messages in thread

end of thread, other threads:[~2023-10-31 14:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-27  8:39 [PATCH 5.15 1/2] drm/amd: Move helper for dynamic speed switch check out of smu13 Mario Limonciello
2023-10-27  8:39 ` [PATCH 5.15 2/2] drm/amd: Disable ASPM for VI w/ all Intel systems Mario Limonciello
2023-10-31 11:51   ` Greg KH
2023-10-31 13:42     ` Mario Limonciello
2023-10-31 14:11       ` Greg KH
2023-10-31 11:50 ` [PATCH 5.15 1/2] drm/amd: Move helper for dynamic speed switch check out of smu13 Greg KH
2023-10-31 13:44   ` Mario Limonciello
2023-10-31 14:10     ` Greg KH

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