Skip to content

Commit fa3aa7a

Browse files
fweisbecKAGA-KOKO
authored andcommitted
jiffies: Revert bogus conversion of NSEC_PER_SEC to TICK_NSEC
commit 93825f2 converted NSEC_PER_SEC to TICK_NSEC because the author confused NSEC_PER_JIFFY with NSEC_PER_SEC. As a result, the calculation of refined jiffies got broken, triggering lockups. Fixes: 93825f2 ("jiffies: Reuse TICK_NSEC instead of NSEC_PER_JIFFY") Reported-and-tested-by: Meelis Roos <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
1 parent 25b68a8 commit fa3aa7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/time/jiffies.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ int register_refined_jiffies(long cycles_per_second)
125125
shift_hz += cycles_per_tick/2;
126126
do_div(shift_hz, cycles_per_tick);
127127
/* Calculate nsec_per_tick using shift_hz */
128-
nsec_per_tick = (u64)TICK_NSEC << 8;
128+
nsec_per_tick = (u64)NSEC_PER_SEC << 8;
129129
nsec_per_tick += (u32)shift_hz/2;
130130
do_div(nsec_per_tick, (u32)shift_hz);
131131

0 commit comments

Comments
 (0)