[patch] rt,mce: fix mce timer interval

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Seems mce timer fire at the wrong frequency in -rt kernels since roughly
forever due to 32 bit overflow.  3.8-rt is also missing a multiplier.

Add missing us -> ns conversion and 32 bit overflow prevention.

Signed-off-by: Mike Galbraith <bitbucket@xxxxxxxxx>
---
 arch/x86/kernel/cpu/mcheck/mce.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1295,7 +1295,7 @@ static enum hrtimer_restart mce_timer_fn
 	__this_cpu_write(mce_next_interval, iv);
 	/* Might have become 0 after CMCI storm subsided */
 	if (iv) {
-		hrtimer_forward_now(timer, ns_to_ktime(jiffies_to_usecs(iv)));
+		hrtimer_forward_now(timer, ns_to_ktime((u64)jiffies_to_usecs(iv) * 1000));
 		return HRTIMER_RESTART;
 	}
 	return HRTIMER_NORESTART;
@@ -1323,7 +1323,7 @@ void mce_timer_kick(unsigned long interv
 		}
 	} else {
 		hrtimer_start_range_ns(t,
-				ns_to_ktime(jiffies_to_usecs(interval) * 1000),
+				ns_to_ktime((u64)jiffies_to_usecs(interval) * 1000),
 				0, HRTIMER_MODE_REL_PINNED);
 	}
 	if (interval < iv)
@@ -1691,7 +1691,7 @@ static void mce_start_timer(unsigned int
 	if (mca_cfg.ignore_ce || !iv)
 		return;
 
-	hrtimer_start_range_ns(t, ns_to_ktime(jiffies_to_usecs(iv) * 1000),
+	hrtimer_start_range_ns(t, ns_to_ktime((u64)jiffies_to_usecs(iv) * 1000),
 			0, HRTIMER_MODE_REL_PINNED);
 }
 


--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux