sched_clock: document 4Mhz vs 1Mhz decision
Stephen Boyd [Thu, 7 Nov 2013 01:00:01 +0000 (12:00 +1100)]
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.

Bug 1399318

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>
(cherry picked from commit 21e79dee7fe571f59aca2d946032736b0d89ef46)
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Change-Id: If9755b79575739f8be1a4a221a05b34f19ef4b78

kernel/time/sched_clock.c

index 68b7993..6c1b534 100644 (file)
@@ -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';