drm/amd/amdgpu: decouple ASPM with pcie dpm
Subsystems (2)
PATCH 1/2 drm/amd/amdgpu: decouple ASPM with pcie dpm
ASPM doesn't need to be disabled if pcie dpm is disabled. So ASPM can be independantly enabled.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -2
@@ -1897,8 +1897,6 @@ bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev) }if (adev->flags &AMD_IS_APU )return false; -if (!(adev->pm.pp_feature &PP_PCIE_DPM_MASK )) -return false;return pcie_aspm_enabled (adev->pdev); }
Signature · 1 line
2.34.1
PATCH 2/2 drm/amd/amdgpu: disable ASPM in some situations
disable ASPM with some ASICs on some specific platforms. required from PCIe controller owner.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +32 -0
@@ -85,6 +85,7 @@#if IS_ENABLED (CONFIG_X86 )#include <asm/intel-family.h> +#include <asm/cpu_device_id.h> #endif MODULE_FIRMWARE ("amdgpu/vega10_gpu_info.bin" );
@@ -1873,6 +1874,35 @@ static bool amdgpu_device_pcie_dynamic_switching_supported(struct amdgpu_devicereturn true; } +static bool amdgpu_device_aspm_support_quirk (struct amdgpu_device *adev) +{ +#if IS_ENABLED (CONFIG_X86 ) +struct cpuinfo_x86 *c = &cpu_data (0 ); + +if (!(amdgpu_ip_version (adev,GC_HWIP ,0 ) ==IP_VERSION (12 ,0 ,0 ) || +amdgpu_ip_version (adev,GC_HWIP ,0 ) ==IP_VERSION (12 ,0 ,1 ))) +return false; + +if (c->x86 ==6 && + adev->pm.pcie_gen_mask &CAIL_PCIE_LINK_SPEED_SUPPORT_GEN5 ) { +switch (c->x86_model) { +case VFM_MODEL (INTEL_ALDERLAKE ): +case VFM_MODEL (INTEL_ALDERLAKE_L ): +case VFM_MODEL (INTEL_RAPTORLAKE ): +case VFM_MODEL (INTEL_RAPTORLAKE_P ): +case VFM_MODEL (INTEL_RAPTORLAKE_S ): +return true; +default : +return false; + } + }else { +return false; + } +#else +return false; +#endif +} +/** * amdgpu_device_should_use_aspm - check if the device should program ASPM *
@@ -1897,6 +1927,8 @@ bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev) }if (adev->flags &AMD_IS_APU )return false; +if (amdgpu_device_aspm_support_quirk (adev)) +return false;return pcie_aspm_enabled (adev->pdev); }
Signature · 1 line
2.34.1
RE: [PATCH 2/2] drm/amd/amdgpu: disable ASPM in some situations
[AMD Official Use Only - AMD Internal Distribution Only]
Series is
Best Regards,
Kevin
-----Original Message-----
From: Kenneth Feng <[email protected]>
Sent: Tuesday, April 1, 2025 16:08
To: [email protected]
Cc: Wang, Yang(Kevin) <[email protected]>; Feng, Kenneth <[email protected]>
Subject: [PATCH 2/2] drm/amd/amdgpu: disable ASPM in some situations
disable ASPM with some ASICs on some specific platforms. required from PCIe controller owner.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +31 -0
@@ -85,6 +85,7 @@#if IS_ENABLED (CONFIG_X86 )#include <asm/intel-family.h> +#include <asm/cpu_device_id.h> #endif MODULE_FIRMWARE ("amdgpu/vega10_gpu_info.bin" );
@@ -1873,6 +1874,35 @@ static bool amdgpu_device_pcie_dynamic_switching_supported(struct amdgpu_devicereturn true; } +static bool amdgpu_device_aspm_support_quirk (struct amdgpu_device +*adev) {#if IS_ENABLED (CONFIG_X86 ) +struct cpuinfo_x86 *c = &cpu_data (0 ); + +if (!(amdgpu_ip_version (adev,GC_HWIP ,0 ) ==IP_VERSION (12 ,0 ,0 ) || +amdgpu_ip_version (adev,GC_HWIP ,0 ) ==IP_VERSION (12 ,0 ,1 ))) +return false; + +if (c->x86 ==6 && + adev->pm.pcie_gen_mask &CAIL_PCIE_LINK_SPEED_SUPPORT_GEN5 ) { +switch (c->x86_model) { +case VFM_MODEL (INTEL_ALDERLAKE ): +case VFM_MODEL (INTEL_ALDERLAKE_L ): +case VFM_MODEL (INTEL_RAPTORLAKE ): +case VFM_MODEL (INTEL_RAPTORLAKE_P ): +case VFM_MODEL (INTEL_RAPTORLAKE_S ): +return true; +default : +return false; + } + }else { +return false; + } +#else +return false; +#endif +} +/** * amdgpu_device_should_use_aspm - check if the device should program ASPM *
@@ -1897,6 +1927,8 @@ bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev) }if (adev->flags &AMD_IS_APU )return false; +if (amdgpu_device_aspm_support_quirk (adev)) +return false;return pcie_aspm_enabled (adev->pdev); }
--
2.34.1