Commit 5e06b649 authored by Russell King's avatar Russell King

ARM: ensure all sched_clock() implementations are notrace marked

ftrace requires sched_clock() to be notrace.  Ensure that all
implementations are so marked.  Also make sure that they include
linux/sched.h

Also ensure OMAP clocksource read functions are marked notrace as
they're used for sched_clock() too.
Tested-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: default avatarWill Deacon <will.deacon@arm.com>
Tested-by: default avatarMikael Pettersson <mikpe@it.uu.se>
Tested-by: default avatarEric Miao <eric.y.miao@gmail.com>
Tested-by: default avatarOlof Johansson <olof@lixom.net>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 684e94cb
...@@ -424,7 +424,7 @@ static void __init ixp4xx_clocksource_init(void) ...@@ -424,7 +424,7 @@ static void __init ixp4xx_clocksource_init(void)
/* /*
* sched_clock() * sched_clock()
*/ */
unsigned long long sched_clock(void) unsigned long long notrace sched_clock(void)
{ {
cycle_t cyc = ixp4xx_get_cycles(NULL); cycle_t cyc = ixp4xx_get_cycles(NULL);
struct clocksource *cs = &clocksource_ixp4xx; struct clocksource *cs = &clocksource_ixp4xx;
......
...@@ -75,7 +75,7 @@ static inline uint32_t timer_read(void) ...@@ -75,7 +75,7 @@ static inline uint32_t timer_read(void)
return __raw_readl(TIMERS_VIRT_BASE + TMR_CVWR(0)); return __raw_readl(TIMERS_VIRT_BASE + TMR_CVWR(0));
} }
unsigned long long sched_clock(void) unsigned long long notrace sched_clock(void)
{ {
unsigned long long v = cnt32_to_63(timer_read()); unsigned long long v = cnt32_to_63(timer_read());
return (v * tcr2ns_scale) >> TCR2NS_SCALE_FACTOR; return (v * tcr2ns_scale) >> TCR2NS_SCALE_FACTOR;
......
...@@ -51,7 +51,7 @@ static void __init set_oscr2ns_scale(unsigned long oscr_rate) ...@@ -51,7 +51,7 @@ static void __init set_oscr2ns_scale(unsigned long oscr_rate)
oscr2ns_scale++; oscr2ns_scale++;
} }
unsigned long long sched_clock(void) unsigned long long notrace sched_clock(void)
{ {
unsigned long long v = cnt32_to_63(OSCR); unsigned long long v = cnt32_to_63(OSCR);
return (v * oscr2ns_scale) >> OSCR2NS_SCALE_FACTOR; return (v * oscr2ns_scale) >> OSCR2NS_SCALE_FACTOR;
......
...@@ -119,7 +119,7 @@ unsigned int sa11x0_getspeed(unsigned int cpu) ...@@ -119,7 +119,7 @@ unsigned int sa11x0_getspeed(unsigned int cpu)
* *
* ( * 1E9 / 3686400 => * 78125 / 288) * ( * 1E9 / 3686400 => * 78125 / 288)
*/ */
unsigned long long sched_clock(void) unsigned long long notrace sched_clock(void)
{ {
unsigned long long v = cnt32_to_63(OSCR); unsigned long long v = cnt32_to_63(OSCR);
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include <linux/init.h> #include <linux/init.h>
#include <linux/sched.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/irq.h> #include <linux/irq.h>
...@@ -110,7 +111,7 @@ static struct clocksource tegra_clocksource = { ...@@ -110,7 +111,7 @@ static struct clocksource tegra_clocksource = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS, .flags = CLOCK_SOURCE_IS_CONTINUOUS,
}; };
unsigned long long sched_clock(void) unsigned long long notrace sched_clock(void)
{ {
return cnt32_to_63(timer_readl(TIMERUS_CNTR_1US)) * 1000; return cnt32_to_63(timer_readl(TIMERUS_CNTR_1US)) * 1000;
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
* Author: Linus Walleij <linus.walleij@stericsson.com> * Author: Linus Walleij <linus.walleij@stericsson.com>
*/ */
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/timex.h> #include <linux/timex.h>
#include <linux/clockchips.h> #include <linux/clockchips.h>
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/sched.h>
#include <linux/timex.h> #include <linux/timex.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
...@@ -52,7 +53,7 @@ static struct clocksource iop_clocksource = { ...@@ -52,7 +53,7 @@ static struct clocksource iop_clocksource = {
/* /*
* IOP sched_clock() implementation via its clocksource. * IOP sched_clock() implementation via its clocksource.
*/ */
unsigned long long sched_clock(void) unsigned long long notrace sched_clock(void)
{ {
cycle_t cyc = iop_clocksource_read(NULL); cycle_t cyc = iop_clocksource_read(NULL);
struct clocksource *cs = &iop_clocksource; struct clocksource *cs = &iop_clocksource;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/cnt32_to_63.h> #include <linux/cnt32_to_63.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/sched.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include <plat/mtu.h> #include <plat/mtu.h>
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/sched.h>
#include <plat/common.h> #include <plat/common.h>
#include <plat/board.h> #include <plat/board.h>
...@@ -44,7 +45,7 @@ ...@@ -44,7 +45,7 @@
static u32 offset_32k __read_mostly; static u32 offset_32k __read_mostly;
#ifdef CONFIG_ARCH_OMAP16XX #ifdef CONFIG_ARCH_OMAP16XX
static cycle_t omap16xx_32k_read(struct clocksource *cs) static cycle_t notrace omap16xx_32k_read(struct clocksource *cs)
{ {
return omap_readl(OMAP16XX_TIMER_32K_SYNCHRONIZED) - offset_32k; return omap_readl(OMAP16XX_TIMER_32K_SYNCHRONIZED) - offset_32k;
} }
...@@ -53,7 +54,7 @@ static cycle_t omap16xx_32k_read(struct clocksource *cs) ...@@ -53,7 +54,7 @@ static cycle_t omap16xx_32k_read(struct clocksource *cs)
#endif #endif
#ifdef CONFIG_ARCH_OMAP2420 #ifdef CONFIG_ARCH_OMAP2420
static cycle_t omap2420_32k_read(struct clocksource *cs) static cycle_t notrace omap2420_32k_read(struct clocksource *cs)
{ {
return omap_readl(OMAP2420_32KSYNCT_BASE + 0x10) - offset_32k; return omap_readl(OMAP2420_32KSYNCT_BASE + 0x10) - offset_32k;
} }
...@@ -62,7 +63,7 @@ static cycle_t omap2420_32k_read(struct clocksource *cs) ...@@ -62,7 +63,7 @@ static cycle_t omap2420_32k_read(struct clocksource *cs)
#endif #endif
#ifdef CONFIG_ARCH_OMAP2430 #ifdef CONFIG_ARCH_OMAP2430
static cycle_t omap2430_32k_read(struct clocksource *cs) static cycle_t notrace omap2430_32k_read(struct clocksource *cs)
{ {
return omap_readl(OMAP2430_32KSYNCT_BASE + 0x10) - offset_32k; return omap_readl(OMAP2430_32KSYNCT_BASE + 0x10) - offset_32k;
} }
...@@ -71,7 +72,7 @@ static cycle_t omap2430_32k_read(struct clocksource *cs) ...@@ -71,7 +72,7 @@ static cycle_t omap2430_32k_read(struct clocksource *cs)
#endif #endif
#ifdef CONFIG_ARCH_OMAP3 #ifdef CONFIG_ARCH_OMAP3
static cycle_t omap34xx_32k_read(struct clocksource *cs) static cycle_t notrace omap34xx_32k_read(struct clocksource *cs)
{ {
return omap_readl(OMAP3430_32KSYNCT_BASE + 0x10) - offset_32k; return omap_readl(OMAP3430_32KSYNCT_BASE + 0x10) - offset_32k;
} }
...@@ -80,7 +81,7 @@ static cycle_t omap34xx_32k_read(struct clocksource *cs) ...@@ -80,7 +81,7 @@ static cycle_t omap34xx_32k_read(struct clocksource *cs)
#endif #endif
#ifdef CONFIG_ARCH_OMAP4 #ifdef CONFIG_ARCH_OMAP4
static cycle_t omap44xx_32k_read(struct clocksource *cs) static cycle_t notrace omap44xx_32k_read(struct clocksource *cs)
{ {
return omap_readl(OMAP4430_32KSYNCT_BASE + 0x10) - offset_32k; return omap_readl(OMAP4430_32KSYNCT_BASE + 0x10) - offset_32k;
} }
...@@ -92,7 +93,7 @@ static cycle_t omap44xx_32k_read(struct clocksource *cs) ...@@ -92,7 +93,7 @@ static cycle_t omap44xx_32k_read(struct clocksource *cs)
* Kernel assumes that sched_clock can be called early but may not have * Kernel assumes that sched_clock can be called early but may not have
* things ready yet. * things ready yet.
*/ */
static cycle_t omap_32k_read_dummy(struct clocksource *cs) static cycle_t notrace omap_32k_read_dummy(struct clocksource *cs)
{ {
return 0; return 0;
} }
...@@ -109,7 +110,7 @@ static struct clocksource clocksource_32k = { ...@@ -109,7 +110,7 @@ static struct clocksource clocksource_32k = {
* Returns current time from boot in nsecs. It's OK for this to wrap * Returns current time from boot in nsecs. It's OK for this to wrap
* around for now, as it's just a relative time stamp. * around for now, as it's just a relative time stamp.
*/ */
unsigned long long sched_clock(void) unsigned long long notrace sched_clock(void)
{ {
return clocksource_cyc2ns(clocksource_32k.read(&clocksource_32k), return clocksource_cyc2ns(clocksource_32k.read(&clocksource_32k),
clocksource_32k.mult, clocksource_32k.shift); clocksource_32k.mult, clocksource_32k.shift);
......
...@@ -55,7 +55,7 @@ static u32 ticks_per_jiffy; ...@@ -55,7 +55,7 @@ static u32 ticks_per_jiffy;
static unsigned long tclk2ns_scale; static unsigned long tclk2ns_scale;
unsigned long long sched_clock(void) unsigned long long notrace sched_clock(void)
{ {
unsigned long long v = cnt32_to_63(0xffffffff - readl(TIMER0_VAL)); unsigned long long v = cnt32_to_63(0xffffffff - readl(TIMER0_VAL));
return (v * tclk2ns_scale) >> TCLK2NS_SCALE_FACTOR; return (v * tclk2ns_scale) >> TCLK2NS_SCALE_FACTOR;
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
* long as there is always less than 89 seconds between successive * long as there is always less than 89 seconds between successive
* calls to this function. * calls to this function.
*/ */
unsigned long long sched_clock(void) unsigned long long notrace sched_clock(void)
{ {
unsigned long long v = cnt32_to_63(readl(REFCOUNTER)); unsigned long long v = cnt32_to_63(readl(REFCOUNTER));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment