drm/amd/pm: fix amdgpu_pm_info power display units
authorYang Wang <kevinyang.wang@amd.com>
Thu, 18 Jun 2026 04:54:14 +0000 (12:54 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Jul 2026 16:58:16 +0000 (12:58 -0400)
commit238baca26a6279e688d1a156bd031390b82eb578
tree19a39657915dce781e55996b0f87c9cb2651933e
parent53c78ab388bfc1a4d72e756815d0db0a842c812e
drm/amd/pm: fix amdgpu_pm_info power display units

amdgpu_pm_info displayed power sensor readings with the wrong fractional unit.
It treated the low byte of the raw sensor value as the decimal part of watts,
while that field represents milliwatts in the decoded value. As a result,
debugfs could report misleading SoC power when the remainder was not already
a two-digit centiwatt value.

Example with query = 0x00000354:

  raw field        value
  ---------------------
  query >> 8       3 W
  query & 0xff     84 mW
  decoded power    3084 mW

  output           value
  ---------------------
  before           3.84 W
  after            3.08 W

Fixes: f0b8f65b4825 ("drm/amd/amdgpu: fix the GPU power print error in pm info")
Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 01992b121fb652c753d37e0c1427a2d1a557d2b1)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/pm/amdgpu_pm.c