drm/xe/hwmon: Simplify and fix 32b wrap
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 30 May 2025 22:31:57 +0000 (15:31 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Mon, 2 Jun 2025 16:34:08 +0000 (09:34 -0700)
commitdea7a2b4f60e04b80f43e3281cdbb29a2aa29152
tree505b97b822178f4846a22c5d9c455e3aa7dfc0b9
parentccd3c6820a9024bcb68c249b644b5e42f0f7b9d2
drm/xe/hwmon: Simplify and fix 32b wrap

Like done in commit eaa287069a70 ("drm/xe/guc_submit: Simplify and fix
diff calculation"), just use u32 for wrapping the value, which is
simpler and more correct: when wrapping on 32b, the accumulated value
was off by one.

Also, do not mix the u64 value from pmt with the u32 value used for the
calculation.

Cc: Badal Nilawar <badal.nilawar@intel.com>
Cc: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Raag Jadav <raag.jadav@intel.com>
Link: https://lore.kernel.org/r/20250530-xe-hwmon-wrap-v2-1-ce653db7fe4a@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_hwmon.c