]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/xe: Fix conversion from clock ticks to milliseconds
authorHarish Chegondi <harish.chegondi@intel.com>
Mon, 17 Nov 2025 19:48:43 +0000 (11:48 -0800)
committerAshutosh Dixit <ashutosh.dixit@intel.com>
Fri, 21 Nov 2025 23:19:03 +0000 (15:19 -0800)
commit96b93ac214f9dd66294d975d86c5dee256faef91
tree6dc869f84a8945f5d5c518803d6eba96b2a10f9f
parentea944d57eac746f9bd9056134751708c48084207
drm/xe: Fix conversion from clock ticks to milliseconds

When tick counts are large and multiplication by MSEC_PER_SEC is larger
than 64 bits, the conversion from clock ticks to milliseconds can go bad.

Use mul_u64_u32_div() instead.

Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Suggested-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Fixes: 49cc215aad7f ("drm/xe: Add xe_gt_clock_interval_to_ms helper")
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Link: https://patch.msgid.link/1562f1b62d5be3fbaee100f09107f3cc49e40dd1.1763408584.git.harish.chegondi@intel.com
drivers/gpu/drm/xe/xe_gt_clock.c