Skip to content

Commit 2b07244

Browse files
Kai-Heng Fengalexdeucher
authored andcommitted
drm/amdgpu/nv: Apply ASPM quirk on Intel ADL + AMD Navi
S2idle resume freeze can be observed on Intel ADL + AMD WX5500. This is caused by commit 0064b0c ("drm/amd/pm: enable ASPM by default"). The root cause is still not clear for now. So extend and apply the ASPM quirk from commit e02fe3b ("drm/amdgpu: vi: disable ASPM on Intel Alder Lake based systems"), to workaround the issue on Navi cards too. Fixes: 0064b0c ("drm/amd/pm: enable ASPM by default") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2458 Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
1 parent 6d457ca commit 2b07244

4 files changed

Lines changed: 18 additions & 17 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,6 +1272,7 @@ void amdgpu_device_pci_config_reset(struct amdgpu_device *adev);
12721272
int amdgpu_device_pci_reset(struct amdgpu_device *adev);
12731273
bool amdgpu_device_need_post(struct amdgpu_device *adev);
12741274
bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev);
1275+
bool amdgpu_device_aspm_support_quirk(void);
12751276

12761277
void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes,
12771278
u64 num_vis_bytes);

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@
8080

8181
#include <drm/drm_drv.h>
8282

83+
#if IS_ENABLED(CONFIG_X86)
84+
#include <asm/intel-family.h>
85+
#endif
86+
8387
MODULE_FIRMWARE("amdgpu/vega10_gpu_info.bin");
8488
MODULE_FIRMWARE("amdgpu/vega12_gpu_info.bin");
8589
MODULE_FIRMWARE("amdgpu/raven_gpu_info.bin");
@@ -1356,6 +1360,17 @@ bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev)
13561360
return pcie_aspm_enabled(adev->pdev);
13571361
}
13581362

1363+
bool amdgpu_device_aspm_support_quirk(void)
1364+
{
1365+
#if IS_ENABLED(CONFIG_X86)
1366+
struct cpuinfo_x86 *c = &cpu_data(0);
1367+
1368+
return !(c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
1369+
#else
1370+
return true;
1371+
#endif
1372+
}
1373+
13591374
/* if we get transitioned to only one device, take VGA back */
13601375
/**
13611376
* amdgpu_device_vga_set_decode - enable/disable vga decode

drivers/gpu/drm/amd/amdgpu/nv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ static void nv_pcie_gen3_enable(struct amdgpu_device *adev)
578578

579579
static void nv_program_aspm(struct amdgpu_device *adev)
580580
{
581-
if (!amdgpu_device_should_use_aspm(adev))
581+
if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_aspm_support_quirk())
582582
return;
583583

584584
if (!(adev->flags & AMD_IS_APU) &&

drivers/gpu/drm/amd/amdgpu/vi.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@
8181
#include "mxgpu_vi.h"
8282
#include "amdgpu_dm.h"
8383

84-
#if IS_ENABLED(CONFIG_X86)
85-
#include <asm/intel-family.h>
86-
#endif
87-
8884
#define ixPCIE_LC_L1_PM_SUBSTATE 0x100100C6
8985
#define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK 0x00000001L
9086
#define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK 0x00000002L
@@ -1138,24 +1134,13 @@ static void vi_enable_aspm(struct amdgpu_device *adev)
11381134
WREG32_PCIE(ixPCIE_LC_CNTL, data);
11391135
}
11401136

1141-
static bool aspm_support_quirk_check(void)
1142-
{
1143-
#if IS_ENABLED(CONFIG_X86)
1144-
struct cpuinfo_x86 *c = &cpu_data(0);
1145-
1146-
return !(c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
1147-
#else
1148-
return true;
1149-
#endif
1150-
}
1151-
11521137
static void vi_program_aspm(struct amdgpu_device *adev)
11531138
{
11541139
u32 data, data1, orig;
11551140
bool bL1SS = false;
11561141
bool bClkReqSupport = true;
11571142

1158-
if (!amdgpu_device_should_use_aspm(adev) || !aspm_support_quirk_check())
1143+
if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_aspm_support_quirk())
11591144
return;
11601145

11611146
if (adev->flags & AMD_IS_APU ||

0 commit comments

Comments
 (0)