From: Stephen Boyd Date: Tue, 5 Nov 2013 05:54:54 +0000 (+1100) Subject: sched_clock: document 4Mhz vs 1Mhz decision X-Git-Tag: next-20131105~2^2~325 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=be2c0ba7ef6cdfa2b7b3a52c17f941ecbabe604c;p=karo-tx-linux.git 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 --- 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';