mvebu: backport mainline patches from kernel 3.13
[openwrt/staging/lynxis/omap.git] / target / linux / mvebu / patches-3.10 / 0171-clocksource-armada-370-xp-Register-sched_clock-after.patch
1 From 3d7976bb4a0f34203456cc0e9054b4a6401c9fdb Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Tue, 26 Nov 2013 18:20:14 -0300
4 Subject: [PATCH 171/203] clocksource: armada-370-xp: Register sched_clock
5 after the counter reset
6
7 This commit registers the sched_clock _after_ the counter reset
8 (instead of before). This removes the timestamp 'jump' in kernel
9 log messages.
10
11 Before this change:
12
13 [ 0.000000] sched_clock: 32 bits at 25MHz, resolution 40ns, wraps every 171798691800ns
14 [ 0.000000] Initializing Coherency fabric
15 [ 0.000000] Aurora cache controller enabled
16 [ 0.000000] l2x0: 16 ways, CACHE_ID 0x00000100, AUX_CTRL 0x1a696b12, Cache size: 1024 kB
17 [ 163.507447] Calibrating delay loop... 1325.05 BogoMIPS (lpj=662528)
18 [ 163.521419] pid_max: default: 32768 minimum: 301
19 [ 163.526185] Mount-cache hash table entries: 512
20 [ 163.531095] CPU: Testing write buffer coherency: ok
21
22 After this change:
23
24 [ 0.000000] sched_clock: 32 bits at 25MHz, resolution 40ns, wraps every 171798691800ns
25 [ 0.000000] Initializing Coherency fabric
26 [ 0.000000] Aurora cache controller enabled
27 [ 0.000000] l2x0: 16 ways, CACHE_ID 0x00000100, AUX_CTRL 0x1a696b12, Cache size: 1024 kB
28 [ 0.016849] Calibrating delay loop... 1325.05 BogoMIPS (lpj=662528)
29 [ 0.030820] pid_max: default: 32768 minimum: 301
30 [ 0.035588] Mount-cache hash table entries: 512
31 [ 0.040500] CPU: Testing write buffer coherency: ok
32
33 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
34 Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
35 Acked-by: Jason Cooper <jason@lakedaemon.net>
36 ---
37 drivers/clocksource/time-armada-370-xp.c | 10 +++++-----
38 1 file changed, 5 insertions(+), 5 deletions(-)
39
40 --- a/drivers/clocksource/time-armada-370-xp.c
41 +++ b/drivers/clocksource/time-armada-370-xp.c
42 @@ -250,11 +250,6 @@ static void __init armada_370_xp_timer_c
43 ticks_per_jiffy = (timer_clk + HZ / 2) / HZ;
44
45 /*
46 - * Set scale and timer for sched_clock.
47 - */
48 - setup_sched_clock(armada_370_xp_read_sched_clock, 32, timer_clk);
49 -
50 - /*
51 * Setup free-running clocksource timer (interrupts
52 * disabled).
53 */
54 @@ -264,6 +259,11 @@ static void __init armada_370_xp_timer_c
55 timer_ctrl_clrset(0, TIMER0_EN | TIMER0_RELOAD_EN |
56 TIMER0_DIV(TIMER_DIVIDER_SHIFT));
57
58 + /*
59 + * Set scale and timer for sched_clock.
60 + */
61 + setup_sched_clock(armada_370_xp_read_sched_clock, 32, timer_clk);
62 +
63 clocksource_mmio_init(timer_base + TIMER0_VAL_OFF,
64 "armada_370_xp_clocksource",
65 timer_clk, 300, 32, clocksource_mmio_readl_down);