From df15c083341f675f5bc4a3896f197dec2a4f19a5 Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 13 Jul 2022 03:53:37 +0000 Subject: [PATCH] drm/amdgpu: vi: disable ASPM on Intel Alder Lake based systems From Richard Gong 7a9e13b86536ce6dca54380f19d537b1c80caee3 in linux 5.15.y/5.15.54 aa482ddca85a3485be0e7b83a0789dc4d987670b in mainline linux --- sys/dev/pci/drm/amd/amdgpu/vi.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/amdgpu/vi.c b/sys/dev/pci/drm/amd/amdgpu/vi.c index a9a9bae46a8..d734b492445 100644 --- a/sys/dev/pci/drm/amd/amdgpu/vi.c +++ b/sys/dev/pci/drm/amd/amdgpu/vi.c @@ -81,6 +81,10 @@ #include "mxgpu_vi.h" #include "amdgpu_dm.h" +#if IS_ENABLED(CONFIG_X86) && defined(__linux__) +#include +#endif + #define ixPCIE_LC_L1_PM_SUBSTATE 0x100100C6 #define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK 0x00000001L #define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK 0x00000002L @@ -1134,13 +1138,24 @@ static void vi_enable_aspm(struct amdgpu_device *adev) WREG32_PCIE(ixPCIE_LC_CNTL, data); } +static bool aspm_support_quirk_check(void) +{ +#if IS_ENABLED(CONFIG_X86) + struct cpu_info *ci = curcpu(); + + return !(ci->ci_family == 6 && ci->ci_model == 0x97); +#else + return true; +#endif +} + static void vi_program_aspm(struct amdgpu_device *adev) { u32 data, data1, orig; bool bL1SS = false; bool bClkReqSupport = true; - if (!amdgpu_device_should_use_aspm(adev)) + if (!amdgpu_device_should_use_aspm(adev) || !aspm_support_quirk_check()) return; if (adev->flags & AMD_IS_APU || -- 2.20.1