mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] jiffies: Revert mistaken conversion of NSEC_PER_SEC to TICK_NSEC
@ 2017-03-07  9:55 Frederic Weisbecker
  2017-03-07 10:07 ` [tip:timers/urgent] jiffies: Revert bogus " tip-bot for Frederic Weisbecker
  0 siblings, 1 reply; 2+ messages in thread
From: Frederic Weisbecker @ 2017-03-07  9:55 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Frederic Weisbecker, Ingo Molnar, Peter Zijlstra, Meelis Roos

The following commit:

	93825f2ec736f30e034ab7c9d56b42849c5b00da
	("jiffies: Reuse TICK_NSEC instead of NSEC_PER_JIFFY")

has introduced a wrong rename due to a confusion between NSEC_PER_JIFFY
and NSEC_PER_SEC. As a result, the calculation of refined jiffies got
broken, triggering lockups.

Reported-and-tested-by: Meelis Roos <mroos@linux.ee>
Cc: Meelis Roos <mroos@linux.ee>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
 kernel/time/jiffies.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c
index 7906b3f..4977191 100644
--- a/kernel/time/jiffies.c
+++ b/kernel/time/jiffies.c
@@ -125,7 +125,7 @@ int register_refined_jiffies(long cycles_per_second)
 	shift_hz += cycles_per_tick/2;
 	do_div(shift_hz, cycles_per_tick);
 	/* Calculate nsec_per_tick using shift_hz */
-	nsec_per_tick = (u64)TICK_NSEC << 8;
+	nsec_per_tick = (u64)NSEC_PER_SEC << 8;
 	nsec_per_tick += (u32)shift_hz/2;
 	do_div(nsec_per_tick, (u32)shift_hz);
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-07 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07  9:55 [PATCH] jiffies: Revert mistaken conversion of NSEC_PER_SEC to TICK_NSEC Frederic Weisbecker
2017-03-07 10:07 ` [tip:timers/urgent] jiffies: Revert bogus " tip-bot for Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome