[PATCH 2/3][SRU][J/OEM-5.17] drm/amd: Use amdgpu_device_should_use_aspm on navi umd pstate switching

Koba Ko koba.ko at canonical.com
Tue Jul 5 14:08:19 UTC 2022


From: Mario Limonciello <mario.limonciello at amd.com>

BugLink: https://bugs.launchpad.net/bugs/1966680

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 <lijo.lazar at amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello at amd.com>
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
(cherry picked from commit d01899d3db2a553268dd4bc03641d9e80e41d67a)
Signed-off-by: Koba Ko <koba.ko at canonical.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 0acef9d1dc1fb..6d34fea3dcc36 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -700,7 +700,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;
-- 
2.34.1




More information about the kernel-team mailing list