drm/amd: Fix logic error in sienna_cichlid_update_pcie_parameters()
authorMario Limonciello <mario.limonciello@amd.com>
Wed, 27 Sep 2023 02:07:43 +0000 (21:07 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Oct 2023 20:00:39 +0000 (22:00 +0200)
commitd2894c4f473ab71cd68ef0f9b086148bb2c02132
tree21ce2b135df13006e6e071e42ba2f16cd17a0999
parentc8bd3e12b3291e632ae189619169914743ba77d1
drm/amd: Fix logic error in sienna_cichlid_update_pcie_parameters()

commit 2a1fe39a5be785e962e387146aed34fa9a829f3f upstream.

While aligning SMU11 with SMU13 implementation an assumption was made that
`dpm_context->dpm_tables.pcie_table` was populated in dpm table initialization
like in SMU13 but it isn't.

So restore some of the original logic and instead just check for
amdgpu_device_pcie_dynamic_switching_supported() to decide whether to hardcode
values; erring on the side of performance.

Cc: stable@vger.kernel.org # 6.1+
Reported-and-tested-by: Umio Yasuno <coelacanth_dream@protonmail.com>
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1447#note_2101382
Fixes: e701156ccc6c ("drm/amd: Align SMU11 SMU_MSG_OverridePcieParameters implementation with SMU13")
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c