drm/amdgpu: Fix bug in reporting voltage for CIK
authorSandeep Raghuraman <sandy.8925@gmail.com>
Thu, 27 Aug 2020 13:13:37 +0000 (18:43 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Sep 2020 11:55:37 +0000 (13:55 +0200)
commit4898d0e064b9aa5d5697e4b5844384ed8ccddae0
tree725d3ec01d9c313f455dd47d52fa37a19fcd4720
parente688f4fbb37eb15d363ed1ac94aab79f65d137f5
drm/amdgpu: Fix bug in reporting voltage for CIK

[ Upstream commit d98299885c9ea140c1108545186593deba36c4ac ]

On my R9 390, the voltage was reported as a constant 1000 mV.
This was due to a bug in smu7_hwmgr.c, in the smu7_read_sensor()
function, where some magic constants were used in a condition,
to determine whether the voltage should be read from PLANE2_VID
or PLANE1_VID. The VDDC mask was incorrectly used, instead of
the VDDGFX mask.

This patch changes the code to use the correct defined constants
(and apply the correct bitshift), thus resulting in correct voltage reporting.

Signed-off-by: Sandeep Raghuraman <sandy.8925@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c