From be2c0ba7ef6cdfa2b7b3a52c17f941ecbabe604c Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Tue, 5 Nov 2013 16:54:54 +1100 Subject: [PATCH] sched_clock: document 4Mhz vs 1Mhz decision Bo Shen sent a patch to change this to 1Mhz instead of 4Mhz but according to Russell King the use of 4Mhz was intentional. Add a comment to this effect so that others don't try to change the code as well. Signed-off-by: Stephen Boyd Cc: Bo Shen Cc: Russell King Cc: Thomas Gleixner Signed-off-by: Andrew Morton --- kernel/time/sched_clock.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c index 0b479a6a22bb..f9a28dd3f494 100644 --- a/kernel/time/sched_clock.c +++ b/kernel/time/sched_clock.c @@ -128,6 +128,10 @@ void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate) clocks_calc_mult_shift(&cd.mult, &cd.shift, rate, NSEC_PER_SEC, 0); r = rate; + /* + * Use 4MHz instead of 1MHz so that things like 1.832Mhz show as + * 1832Khz + */ if (r >= 4000000) { r /= 1000000; r_unit = 'M'; -- 2.39.5