drm/amd: Use amdgpu_device_should_use_aspm on navi umd pstate switching
authorMario Limonciello <mario.limonciello@amd.com>
Thu, 17 Feb 2022 05:30:21 +0000 (23:30 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 17 Feb 2022 20:59:05 +0000 (15:59 -0500)
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@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/nv.c

index a4a6362..f1285cf 100644 (file)
@@ -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;