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)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 3 Sep 2020 04:37:14 +0000 (00:37 -0400)
commitd98299885c9ea140c1108545186593deba36c4ac
tree401a7e068fa1861a38922470feaa4ef3c9ee598c
parentf7b2e34b4afb8d712913dc199d3292ea9e078637
drm/amdgpu: Fix bug in reporting voltage for CIK

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>
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c