aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig1
-rw-r--r--arch/arm/common/timer-sp.c2
-rw-r--r--arch/arm/include/asm/sched_clock.h18
-rw-r--r--arch/arm/kernel/Makefile2
-rw-r--r--arch/arm/kernel/arch_timer.c2
-rw-r--r--arch/arm/kernel/sched_clock.c217
-rw-r--r--arch/arm/kernel/time.c4
-rw-r--r--arch/arm/mach-davinci/time.c2
-rw-r--r--arch/arm/mach-imx/time.c2
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c2
-rw-r--r--arch/arm/mach-ixp4xx/common.c2
-rw-r--r--arch/arm/mach-mmp/time.c2
-rw-r--r--arch/arm/mach-msm/timer.c2
-rw-r--r--arch/arm/mach-omap1/time.c2
-rw-r--r--arch/arm/mach-omap2/timer.c2
-rw-r--r--arch/arm/mach-pxa/time.c2
-rw-r--r--arch/arm/mach-sa1100/time.c2
-rw-r--r--arch/arm/mach-u300/timer.c2
-rw-r--r--arch/arm/plat-iop/time.c2
-rw-r--r--arch/arm/plat-omap/counter_32k.c2
-rw-r--r--arch/arm/plat-orion/time.c2
-rw-r--r--arch/arm/plat-samsung/samsung-time.c2
-rw-r--r--arch/arm/plat-versatile/sched-clock.c2
23 files changed, 24 insertions, 254 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 136f263ed47b..b02e6bbc1b46 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -14,6 +14,7 @@ config ARM
14 select GENERIC_IRQ_PROBE 14 select GENERIC_IRQ_PROBE
15 select GENERIC_IRQ_SHOW 15 select GENERIC_IRQ_SHOW
16 select GENERIC_PCI_IOMAP 16 select GENERIC_PCI_IOMAP
17 select GENERIC_SCHED_CLOCK
17 select GENERIC_SMP_IDLE_THREAD 18 select GENERIC_SMP_IDLE_THREAD
18 select GENERIC_IDLE_POLL_SETUP 19 select GENERIC_IDLE_POLL_SETUP
19 select GENERIC_STRNCPY_FROM_USER 20 select GENERIC_STRNCPY_FROM_USER
diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c
index ddc740769601..023ee63827a2 100644
--- a/arch/arm/common/timer-sp.c
+++ b/arch/arm/common/timer-sp.c
@@ -28,8 +28,8 @@
28#include <linux/of.h> 28#include <linux/of.h>
29#include <linux/of_address.h> 29#include <linux/of_address.h>
30#include <linux/of_irq.h> 30#include <linux/of_irq.h>
31#include <linux/sched_clock.h>
31 32
32#include <asm/sched_clock.h>
33#include <asm/hardware/arm_timer.h> 33#include <asm/hardware/arm_timer.h>
34#include <asm/hardware/timer-sp.h> 34#include <asm/hardware/timer-sp.h>
35 35
diff --git a/arch/arm/include/asm/sched_clock.h b/arch/arm/include/asm/sched_clock.h
index 3d520ddca61b..2389b71a8e7c 100644
--- a/arch/arm/include/asm/sched_clock.h
+++ b/arch/arm/include/asm/sched_clock.h
@@ -1,16 +1,4 @@
1/* 1/* You shouldn't include this file. Use linux/sched_clock.h instead.
2 * sched_clock.h: support for extending counters to full 64-bit ns counter 2 * Temporary file until all asm/sched_clock.h users are gone
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */ 3 */
8#ifndef ASM_SCHED_CLOCK 4#include <linux/sched_clock.h>
9#define ASM_SCHED_CLOCK
10
11extern void sched_clock_postinit(void);
12extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate);
13
14extern unsigned long long (*sched_clock_func)(void);
15
16#endif
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 5f3338eacad2..97cb0576d07c 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -16,7 +16,7 @@ CFLAGS_REMOVE_return_address.o = -pg
16# Object file lists. 16# Object file lists.
17 17
18obj-y := elf.o entry-armv.o entry-common.o irq.o opcodes.o \ 18obj-y := elf.o entry-armv.o entry-common.o irq.o opcodes.o \
19 process.o ptrace.o return_address.o sched_clock.o \ 19 process.o ptrace.o return_address.o \
20 setup.o signal.o stacktrace.o sys_arm.o time.o traps.o 20 setup.o signal.o stacktrace.o sys_arm.o time.o traps.o
21 21
22obj-$(CONFIG_ATAGS) += atags_parse.o 22obj-$(CONFIG_ATAGS) += atags_parse.o
diff --git a/arch/arm/kernel/arch_timer.c b/arch/arm/kernel/arch_timer.c
index 59dcdced6e30..221f07b11ccb 100644
--- a/arch/arm/kernel/arch_timer.c
+++ b/arch/arm/kernel/arch_timer.c
@@ -11,9 +11,9 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/sched_clock.h>
14 15
15#include <asm/delay.h> 16#include <asm/delay.h>
16#include <asm/sched_clock.h>
17 17
18#include <clocksource/arm_arch_timer.h> 18#include <clocksource/arm_arch_timer.h>
19 19
diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
deleted file mode 100644
index e8edcaa0e432..000000000000
--- a/arch/arm/kernel/sched_clock.c
+++ /dev/null
@@ -1,217 +0,0 @@
1/*
2 * sched_clock.c: support for extending counters to full 64-bit ns counter
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8#include <linux/clocksource.h>
9#include <linux/init.h>
10#include <linux/jiffies.h>
11#include <linux/kernel.h>
12#include <linux/moduleparam.h>
13#include <linux/sched.h>
14#include <linux/syscore_ops.h>
15#include <linux/timer.h>
16
17#include <asm/sched_clock.h>
18
19struct clock_data {
20 u64 epoch_ns;
21 u32 epoch_cyc;
22 u32 epoch_cyc_copy;
23 unsigned long rate;
24 u32 mult;
25 u32 shift;
26 bool suspended;
27 bool needs_suspend;
28};
29
30static void sched_clock_poll(unsigned long wrap_ticks);
31static DEFINE_TIMER(sched_clock_timer, sched_clock_poll, 0, 0);
32static int irqtime = -1;
33
34core_param(irqtime, irqtime, int, 0400);
35
36static struct clock_data cd = {
37 .mult = NSEC_PER_SEC / HZ,
38};
39
40static u32 __read_mostly sched_clock_mask = 0xffffffff;
41
42static u32 notrace jiffy_sched_clock_read(void)
43{
44 return (u32)(jiffies - INITIAL_JIFFIES);
45}
46
47static u32 __read_mostly (*read_sched_clock)(void) = jiffy_sched_clock_read;
48
49static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift)
50{
51 return (cyc * mult) >> shift;
52}
53
54static unsigned long long notrace cyc_to_sched_clock(u32 cyc, u32 mask)
55{
56 u64 epoch_ns;
57 u32 epoch_cyc;
58
59 if (cd.suspended)
60 return cd.epoch_ns;
61
62 /*
63 * Load the epoch_cyc and epoch_ns atomically. We do this by
64 * ensuring that we always write epoch_cyc, epoch_ns and
65 * epoch_cyc_copy in strict order, and read them in strict order.
66 * If epoch_cyc and epoch_cyc_copy are not equal, then we're in
67 * the middle of an update, and we should repeat the load.
68 */
69 do {
70 epoch_cyc = cd.epoch_cyc;
71 smp_rmb();
72 epoch_ns = cd.epoch_ns;
73 smp_rmb();
74 } while (epoch_cyc != cd.epoch_cyc_copy);
75
76 return epoch_ns + cyc_to_ns((cyc - epoch_cyc) & mask, cd.mult, cd.shift);
77}
78
79/*
80 * Atomically update the sched_clock epoch.
81 */
82static void notrace update_sched_clock(void)
83{
84 unsigned long flags;
85 u32 cyc;
86 u64 ns;
87
88 cyc = read_sched_clock();
89 ns = cd.epoch_ns +
90 cyc_to_ns((cyc - cd.epoch_cyc) & sched_clock_mask,
91 cd.mult, cd.shift);
92 /*
93 * Write epoch_cyc and epoch_ns in a way that the update is
94 * detectable in cyc_to_fixed_sched_clock().
95 */
96 raw_local_irq_save(flags);
97 cd.epoch_cyc_copy = cyc;
98 smp_wmb();
99 cd.epoch_ns = ns;
100 smp_wmb();
101 cd.epoch_cyc = cyc;
102 raw_local_irq_restore(flags);
103}
104
105static void sched_clock_poll(unsigned long wrap_ticks)
106{
107 mod_timer(&sched_clock_timer, round_jiffies(jiffies + wrap_ticks));
108 update_sched_clock();
109}
110
111void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate)
112{
113 unsigned long r, w;
114 u64 res, wrap;
115 char r_unit;
116
117 if (cd.rate > rate)
118 return;
119
120 BUG_ON(bits > 32);
121 WARN_ON(!irqs_disabled());
122 read_sched_clock = read;
123 sched_clock_mask = (1 << bits) - 1;
124 cd.rate = rate;
125
126 /* calculate the mult/shift to convert counter ticks to ns. */
127 clocks_calc_mult_shift(&cd.mult, &cd.shift, rate, NSEC_PER_SEC, 0);
128
129 r = rate;
130 if (r >= 4000000) {
131 r /= 1000000;
132 r_unit = 'M';
133 } else if (r >= 1000) {
134 r /= 1000;
135 r_unit = 'k';
136 } else
137 r_unit = ' ';
138
139 /* calculate how many ns until we wrap */
140 wrap = cyc_to_ns((1ULL << bits) - 1, cd.mult, cd.shift);
141 do_div(wrap, NSEC_PER_MSEC);
142 w = wrap;
143
144 /* calculate the ns resolution of this counter */
145 res = cyc_to_ns(1ULL, cd.mult, cd.shift);
146 pr_info("sched_clock: %u bits at %lu%cHz, resolution %lluns, wraps every %lums\n",
147 bits, r, r_unit, res, w);
148
149 /*
150 * Start the timer to keep sched_clock() properly updated and
151 * sets the initial epoch.
152 */
153 sched_clock_timer.data = msecs_to_jiffies(w - (w / 10));
154 update_sched_clock();
155
156 /*
157 * Ensure that sched_clock() starts off at 0ns
158 */
159 cd.epoch_ns = 0;
160
161 /* Enable IRQ time accounting if we have a fast enough sched_clock */
162 if (irqtime > 0 || (irqtime == -1 && rate >= 1000000))
163 enable_sched_clock_irqtime();
164
165 pr_debug("Registered %pF as sched_clock source\n", read);
166}
167
168static unsigned long long notrace sched_clock_32(void)
169{
170 u32 cyc = read_sched_clock();
171 return cyc_to_sched_clock(cyc, sched_clock_mask);
172}
173
174unsigned long long __read_mostly (*sched_clock_func)(void) = sched_clock_32;
175
176unsigned long long notrace sched_clock(void)
177{
178 return sched_clock_func();
179}
180
181void __init sched_clock_postinit(void)
182{
183 /*
184 * If no sched_clock function has been provided at that point,
185 * make it the final one one.
186 */
187 if (read_sched_clock == jiffy_sched_clock_read)
188 setup_sched_clock(jiffy_sched_clock_read, 32, HZ);
189
190 sched_clock_poll(sched_clock_timer.data);
191}
192
193static int sched_clock_suspend(void)
194{
195 sched_clock_poll(sched_clock_timer.data);
196 cd.suspended = true;
197 return 0;
198}
199
200static void sched_clock_resume(void)
201{
202 cd.epoch_cyc = read_sched_clock();
203 cd.epoch_cyc_copy = cd.epoch_cyc;
204 cd.suspended = false;
205}
206
207static struct syscore_ops sched_clock_ops = {
208 .suspend = sched_clock_suspend,
209 .resume = sched_clock_resume,
210};
211
212static int __init sched_clock_syscore_init(void)
213{
214 register_syscore_ops(&sched_clock_ops);
215 return 0;
216}
217device_initcall(sched_clock_syscore_init);
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index abff4e9aaee0..98aee3258398 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -24,9 +24,9 @@
24#include <linux/timer.h> 24#include <linux/timer.h>
25#include <linux/clocksource.h> 25#include <linux/clocksource.h>
26#include <linux/irq.h> 26#include <linux/irq.h>
27#include <linux/sched_clock.h>
27 28
28#include <asm/thread_info.h> 29#include <asm/thread_info.h>
29#include <asm/sched_clock.h>
30#include <asm/stacktrace.h> 30#include <asm/stacktrace.h>
31#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
32#include <asm/mach/time.h> 32#include <asm/mach/time.h>
@@ -120,6 +120,4 @@ void __init time_init(void)
120 machine_desc->init_time(); 120 machine_desc->init_time();
121 else 121 else
122 clocksource_of_init(); 122 clocksource_of_init();
123
124 sched_clock_postinit();
125} 123}
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index bad361ec1666..7a55b5c95971 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -18,8 +18,8 @@
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/sched_clock.h>
21 22
22#include <asm/sched_clock.h>
23#include <asm/mach/irq.h> 23#include <asm/mach/irq.h>
24#include <asm/mach/time.h> 24#include <asm/mach/time.h>
25 25
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
index fea91313678b..cd46529e9eaa 100644
--- a/arch/arm/mach-imx/time.c
+++ b/arch/arm/mach-imx/time.c
@@ -26,8 +26,8 @@
26#include <linux/clockchips.h> 26#include <linux/clockchips.h>
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/err.h> 28#include <linux/err.h>
29#include <linux/sched_clock.h>
29 30
30#include <asm/sched_clock.h>
31#include <asm/mach/time.h> 31#include <asm/mach/time.h>
32 32
33#include "common.h" 33#include "common.h"
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index b23c8e4f28e8..aa4346227c41 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -41,6 +41,7 @@
41#include <linux/stat.h> 41#include <linux/stat.h>
42#include <linux/sys_soc.h> 42#include <linux/sys_soc.h>
43#include <linux/termios.h> 43#include <linux/termios.h>
44#include <linux/sched_clock.h>
44#include <video/vga.h> 45#include <video/vga.h>
45 46
46#include <mach/hardware.h> 47#include <mach/hardware.h>
@@ -49,7 +50,6 @@
49#include <asm/setup.h> 50#include <asm/setup.h>
50#include <asm/param.h> /* HZ */ 51#include <asm/param.h> /* HZ */
51#include <asm/mach-types.h> 52#include <asm/mach-types.h>
52#include <asm/sched_clock.h>
53 53
54#include <mach/lm.h> 54#include <mach/lm.h>
55#include <mach/irqs.h> 55#include <mach/irqs.h>
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 6600cff6bd92..58307cff1f18 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -30,6 +30,7 @@
30#include <linux/export.h> 30#include <linux/export.h>
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32#include <linux/cpu.h> 32#include <linux/cpu.h>
33#include <linux/sched_clock.h>
33 34
34#include <mach/udc.h> 35#include <mach/udc.h>
35#include <mach/hardware.h> 36#include <mach/hardware.h>
@@ -38,7 +39,6 @@
38#include <asm/pgtable.h> 39#include <asm/pgtable.h>
39#include <asm/page.h> 40#include <asm/page.h>
40#include <asm/irq.h> 41#include <asm/irq.h>
41#include <asm/sched_clock.h>
42#include <asm/system_misc.h> 42#include <asm/system_misc.h>
43 43
44#include <asm/mach/map.h> 44#include <asm/mach/map.h>
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index 86a18b3d252e..7ac41e83cfef 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -28,8 +28,8 @@
28#include <linux/of.h> 28#include <linux/of.h>
29#include <linux/of_address.h> 29#include <linux/of_address.h>
30#include <linux/of_irq.h> 30#include <linux/of_irq.h>
31#include <linux/sched_clock.h>
31 32
32#include <asm/sched_clock.h>
33#include <mach/addr-map.h> 33#include <mach/addr-map.h>
34#include <mach/regs-timers.h> 34#include <mach/regs-timers.h>
35#include <mach/regs-apbc.h> 35#include <mach/regs-apbc.h>
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
index 284313f3e02c..b6418fd5fe0d 100644
--- a/arch/arm/mach-msm/timer.c
+++ b/arch/arm/mach-msm/timer.c
@@ -23,10 +23,10 @@
23#include <linux/of.h> 23#include <linux/of.h>
24#include <linux/of_address.h> 24#include <linux/of_address.h>
25#include <linux/of_irq.h> 25#include <linux/of_irq.h>
26#include <linux/sched_clock.h>
26 27
27#include <asm/mach/time.h> 28#include <asm/mach/time.h>
28#include <asm/localtimer.h> 29#include <asm/localtimer.h>
29#include <asm/sched_clock.h>
30 30
31#include "common.h" 31#include "common.h"
32 32
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index 726ec23d29c7..80603d2fef77 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -43,9 +43,9 @@
43#include <linux/clocksource.h> 43#include <linux/clocksource.h>
44#include <linux/clockchips.h> 44#include <linux/clockchips.h>
45#include <linux/io.h> 45#include <linux/io.h>
46#include <linux/sched_clock.h>
46 47
47#include <asm/irq.h> 48#include <asm/irq.h>
48#include <asm/sched_clock.h>
49 49
50#include <mach/hardware.h> 50#include <mach/hardware.h>
51#include <asm/mach/irq.h> 51#include <asm/mach/irq.h>
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index f8b23b8040d9..4c069b0cab21 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -41,10 +41,10 @@
41#include <linux/of_irq.h> 41#include <linux/of_irq.h>
42#include <linux/platform_device.h> 42#include <linux/platform_device.h>
43#include <linux/platform_data/dmtimer-omap.h> 43#include <linux/platform_data/dmtimer-omap.h>
44#include <linux/sched_clock.h>
44 45
45#include <asm/mach/time.h> 46#include <asm/mach/time.h>
46#include <asm/smp_twd.h> 47#include <asm/smp_twd.h>
47#include <asm/sched_clock.h>
48 48
49#include "omap_hwmod.h" 49#include "omap_hwmod.h"
50#include "omap_device.h" 50#include "omap_device.h"
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index 8f1ee92aea30..9aa852a8fab9 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -16,11 +16,11 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/clockchips.h> 18#include <linux/clockchips.h>
19#include <linux/sched_clock.h>
19 20
20#include <asm/div64.h> 21#include <asm/div64.h>
21#include <asm/mach/irq.h> 22#include <asm/mach/irq.h>
22#include <asm/mach/time.h> 23#include <asm/mach/time.h>
23#include <asm/sched_clock.h>
24#include <mach/regs-ost.h> 24#include <mach/regs-ost.h>
25#include <mach/irqs.h> 25#include <mach/irqs.h>
26 26
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index a59a13a665a6..713c86cd3d64 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -14,9 +14,9 @@
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/timex.h> 15#include <linux/timex.h>
16#include <linux/clockchips.h> 16#include <linux/clockchips.h>
17#include <linux/sched_clock.h>
17 18
18#include <asm/mach/time.h> 19#include <asm/mach/time.h>
19#include <asm/sched_clock.h>
20#include <mach/hardware.h> 20#include <mach/hardware.h>
21#include <mach/irqs.h> 21#include <mach/irqs.h>
22 22
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c
index d9e73209c9b8..af771b76fe1c 100644
--- a/arch/arm/mach-u300/timer.c
+++ b/arch/arm/mach-u300/timer.c
@@ -18,12 +18,12 @@
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/irq.h> 20#include <linux/irq.h>
21#include <linux/sched_clock.h>
21 22
22#include <mach/hardware.h> 23#include <mach/hardware.h>
23#include <mach/irqs.h> 24#include <mach/irqs.h>
24 25
25/* Generic stuff */ 26/* Generic stuff */
26#include <asm/sched_clock.h>
27#include <asm/mach/map.h> 27#include <asm/mach/map.h>
28#include <asm/mach/time.h> 28#include <asm/mach/time.h>
29 29
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index 837a2d52e9db..29606bd75f3f 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -22,9 +22,9 @@
22#include <linux/clocksource.h> 22#include <linux/clocksource.h>
23#include <linux/clockchips.h> 23#include <linux/clockchips.h>
24#include <linux/export.h> 24#include <linux/export.h>
25#include <linux/sched_clock.h>
25#include <mach/hardware.h> 26#include <mach/hardware.h>
26#include <asm/irq.h> 27#include <asm/irq.h>
27#include <asm/sched_clock.h>
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/mach/irq.h> 29#include <asm/mach/irq.h>
30#include <asm/mach/time.h> 30#include <asm/mach/time.h>
diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c
index 5b0b86bb34bb..d9bc98eb2a6b 100644
--- a/arch/arm/plat-omap/counter_32k.c
+++ b/arch/arm/plat-omap/counter_32k.c
@@ -18,9 +18,9 @@
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/clocksource.h> 20#include <linux/clocksource.h>
21#include <linux/sched_clock.h>
21 22
22#include <asm/mach/time.h> 23#include <asm/mach/time.h>
23#include <asm/sched_clock.h>
24 24
25#include <plat/counter-32k.h> 25#include <plat/counter-32k.h>
26 26
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
index 5d5ac0f05422..9d2b2ac74938 100644
--- a/arch/arm/plat-orion/time.c
+++ b/arch/arm/plat-orion/time.c
@@ -16,7 +16,7 @@
16#include <linux/clockchips.h> 16#include <linux/clockchips.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/irq.h> 18#include <linux/irq.h>
19#include <asm/sched_clock.h> 19#include <linux/sched_clock.h>
20 20
21/* 21/*
22 * MBus bridge block registers. 22 * MBus bridge block registers.
diff --git a/arch/arm/plat-samsung/samsung-time.c b/arch/arm/plat-samsung/samsung-time.c
index f899cbc9b288..2957075ca836 100644
--- a/arch/arm/plat-samsung/samsung-time.c
+++ b/arch/arm/plat-samsung/samsung-time.c
@@ -15,12 +15,12 @@
15#include <linux/clk.h> 15#include <linux/clk.h>
16#include <linux/clockchips.h> 16#include <linux/clockchips.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/sched_clock.h>
18 19
19#include <asm/smp_twd.h> 20#include <asm/smp_twd.h>
20#include <asm/mach/time.h> 21#include <asm/mach/time.h>
21#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
22#include <asm/mach/map.h> 23#include <asm/mach/map.h>
23#include <asm/sched_clock.h>
24 24
25#include <mach/map.h> 25#include <mach/map.h>
26#include <plat/devs.h> 26#include <plat/devs.h>
diff --git a/arch/arm/plat-versatile/sched-clock.c b/arch/arm/plat-versatile/sched-clock.c
index b33b74c87232..51b109e3b6c3 100644
--- a/arch/arm/plat-versatile/sched-clock.c
+++ b/arch/arm/plat-versatile/sched-clock.c
@@ -20,8 +20,8 @@
20 */ 20 */
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/sched_clock.h>
23 24
24#include <asm/sched_clock.h>
25#include <plat/sched_clock.h> 25#include <plat/sched_clock.h>
26 26
27static void __iomem *ctr; 27static void __iomem *ctr;