From: Mario Limonciello Date: Thu, 17 Feb 2022 05:30:21 +0000 (-0600) Subject: drm/amd: Use amdgpu_device_should_use_aspm on navi umd pstate switching X-Git-Tag: v5.18-rc1~134^2~16^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d01899d3db2a553268dd4bc03641d9e80e41d67a;p=thirdparty%2Fkernel%2Flinux.git drm/amd: Use amdgpu_device_should_use_aspm on navi umd pstate switching The `program_aspm` callback is already guarded for aspm, but the `enable_aspm` callback doesn't follow the module parameter. Update it to use the helper `amdgpu_device_should_use_aspm`. Reviewed-by: Lijo Lazar Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c index a4a6362dfb092..f1285cf645178 100644 --- a/drivers/gpu/drm/amd/amdgpu/nv.c +++ b/drivers/gpu/drm/amd/amdgpu/nv.c @@ -637,7 +637,8 @@ static int nv_update_umd_stable_pstate(struct amdgpu_device *adev, adev->gfx.funcs->update_perfmon_mgcg(adev, !enter); if (!(adev->flags & AMD_IS_APU) && - (adev->nbio.funcs->enable_aspm)) + (adev->nbio.funcs->enable_aspm) && + amdgpu_device_should_use_aspm(adev)) adev->nbio.funcs->enable_aspm(adev, !enter); return 0;