Skip to contentSkip to conversation

drm/radeon: fix 64 bit divide in SI spm code

PATCH New [email protected] 1 participant 1 message Aug 1, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: fix 64 bit divide in SI spm code

From: Alex Deucher <[email protected]>

Forgot to use the appropriate math64 function.

---

This is already in my -fixes queue, but for those that are running into issues, here's the fix.

 drivers/gpu/drm/radeon/si_dpm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/radeon/si_dpm.c +1 -1
index 7ad22e8..4182557 100644
@@ -1767,7 +1767,7 @@ static void si_calculate_leakage_for_v_and_t_formula(const struct ni_leakage_coe
 	s64 temperature, t_slope, t_intercept, av, bv, t_ref;
 	s64 tmp;
 
-	i_leakage = drm_int2fixp(ileakage) / 100;
+	i_leakage = div64_s64(drm_int2fixp(ileakage), 100);
 	vddc = div64_s64(drm_int2fixp(v), 1000);
 	temperature = div64_s64(drm_int2fixp(t), 1000);
 
Signature · 1 line
1.7.7.5