]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/amd: Use amdgpu_device_should_use_aspm on navi umd pstate switching
authorMario Limonciello <mario.limonciello@amd.com>
Tue, 5 Jul 2022 14:08:00 +0000 (16:08 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:25:34 +0000 (09:25 +0200)
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@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>
(cherry picked from commit d01899d3db2a553268dd4bc03641d9e80e41d67a)
Signed-off-by: Koba Ko <koba.ko@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/amd/amdgpu/nv.c

index fdcce50b3dfa7988d3a0d629f51445ded4d297fb..7f2430a46c9844191ed45423a7271a4114500e57 100644 (file)
@@ -1001,7 +1001,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;