<div dir="auto"><div>Hi Richard, see inline comment.<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Den fre 8 apr. 2022 21:05Richard Gong <<a href="mailto:richard.gong@amd.com">richard.gong@amd.com</a>> skrev:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Active State Power Management (ASPM) feature is enabled since kernel 5.14.<br>
There are some AMD GFX cards (such as WX3200 and RX640) that cannot be<br>
used with Intel AlderLake based systems to enable ASPM. Using these GFX<br>
cards as video/display output, Intel Alder Lake based systems will hang<br>
during suspend/resume.<br>
<br>
Add extra check to disable ASPM on Intel AlderLake based systems.<br>
<br>
Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default")<br>
Link: <a href="https://gitlab.freedesktop.org/drm/amd/-/issues/1885" rel="noreferrer noreferrer" target="_blank">https://gitlab.freedesktop.org/drm/amd/-/issues/1885</a><br>
Signed-off-by: Richard Gong <<a href="mailto:richard.gong@amd.com" target="_blank" rel="noreferrer">richard.gong@amd.com</a>><br>
---<br>
v2: correct commit description<br>
move the check from chip family to problematic platform<br>
---<br>
drivers/gpu/drm/amd/amdgpu/vi.c | 17 ++++++++++++++++-<br>
1 file changed, 16 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c<br>
index 039b90cdc3bc..8b4eaf54b23e 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/vi.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c<br>
@@ -81,6 +81,10 @@<br>
#include "mxgpu_vi.h"<br>
#include "amdgpu_dm.h"<br>
<br>
+#if IS_ENABLED(CONFIG_X86_64)<br>
+#include <asm/intel-family.h><br>
+#endif<br>
+<br>
#define ixPCIE_LC_L1_PM_SUBSTATE 0x100100C6<br>
#define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK 0x00000001L<br>
#define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK 0x00000002L<br>
@@ -1134,13 +1138,24 @@ static void vi_enable_aspm(struct amdgpu_device *adev)<br>
WREG32_PCIE(ixPCIE_LC_CNTL, data);<br>
}<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div><div dir="auto">There's a typo in the new function name apsm/aspm. Btw might be worth a comment why this check is done?</div><div dir="auto"><br></div><div dir="auto">Regards</div><div dir="auto">Nils</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+static bool intel_core_apsm_chk(void)<br>
+{<br>
+#if IS_ENABLED(CONFIG_X86_64)<br>
+ struct cpuinfo_x86 *c = &cpu_data(0);<br>
+<br>
+ return (c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);<br>
+#else<br>
+ return false;<br>
+#endif<br>
+}<br>
+<br>
static void vi_program_aspm(struct amdgpu_device *adev)<br>
{<br>
u32 data, data1, orig;<br>
bool bL1SS = false;<br>
bool bClkReqSupport = true;<br>
<br>
- if (!amdgpu_device_should_use_aspm(adev))<br>
+ if (!amdgpu_device_should_use_aspm(adev) || intel_core_apsm_chk())<br>
return;<br>
<br>
if (adev->flags & AMD_IS_APU ||<br>
-- <br>
2.25.1<br>
<br>
</blockquote></div></div></div>