summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2014-01-10 12:40:46 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2014-01-10 12:40:46 +1100
commit051750c9efa6bada9279e60163fea0657c6aa289 (patch)
tree9f796401aef492f138c468b7e17ec29ad9d1fe8e
parentf81afd4d324c6cff7846dce5887ca09ddac29136 (diff)
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 <sboyd@codeaurora.org> Cc: Bo Shen <voice.shen@atmel.com> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--kernel/time/sched_clock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c
index 68b799375981..6c1b5343b26c 100644
--- a/kernel/time/sched_clock.c
+++ b/kernel/time/sched_clock.c
@@ -132,6 +132,10 @@ void __init sched_clock_register(u64 (*read)(void), int bits,
clocks_calc_mult_shift(&cd.mult, &cd.shift, rate, NSEC_PER_SEC, 3600);
r = rate;
+ /*
+ * Use 4MHz instead of 1MHz so that things like 1.832Mhz show as
+ * 1832Khz
+ */
if (r >= 4000000) {
r /= 1000000;
r_unit = 'M';