Signed-off-by: Thomas Gleixner --- arch/arm/plat-nomadik/Kconfig | 1 arch/arm/plat-nomadik/timer.c | 45 ++---------------------------------------- 2 files changed, 3 insertions(+), 43 deletions(-) Index: linux-2.6-tip/arch/arm/plat-nomadik/Kconfig =================================================================== --- linux-2.6-tip.orig/arch/arm/plat-nomadik/Kconfig +++ linux-2.6-tip/arch/arm/plat-nomadik/Kconfig @@ -14,7 +14,6 @@ if PLAT_NOMADIK config HAS_MTU bool - select HAVE_SCHED_CLOCK help Support for Multi Timer Unit. MTU provides access to multiple interrupt generating programmable Index: linux-2.6-tip/arch/arm/plat-nomadik/timer.c =================================================================== --- linux-2.6-tip.orig/arch/arm/plat-nomadik/timer.c +++ linux-2.6-tip/arch/arm/plat-nomadik/timer.c @@ -19,23 +19,13 @@ #include #include #include -#include #include void __iomem *mtu_base; /* Assigned by machine code */ -/* - * Kernel assumes that sched_clock can be called early - * but the MTU may not yet be initialized. - */ -static cycle_t nmdk_read_timer_dummy(struct clocksource *cs) -{ - return 0; -} - /* clocksource: MTU decrements, so we negate the value being read. */ -static cycle_t nmdk_read_timer(struct clocksource *cs) +static cycle_t notrace nmdk_read_timer(struct clocksource *cs) { return -readl(mtu_base + MTU_VAL(0)); } @@ -43,35 +33,11 @@ static cycle_t nmdk_read_timer(struct cl static struct clocksource nmdk_clksrc = { .name = "mtu_0", .rating = 200, - .read = nmdk_read_timer_dummy, + .read = nmdk_read_timer, .mask = CLOCKSOURCE_MASK(32), - .flags = CLOCK_SOURCE_IS_CONTINUOUS, + .flags = CLOCK_SOURCE_IS_CONTINUOUS | CLOCK_SOURCE_SCHED_CLOCK, }; -/* - * Override the global weak sched_clock symbol with this - * local implementation which uses the clocksource to get some - * better resolution when scheduling the kernel. - */ -static DEFINE_CLOCK_DATA(cd); - -unsigned long long notrace sched_clock(void) -{ - u32 cyc; - - if (unlikely(!mtu_base)) - return 0; - - cyc = -readl(mtu_base + MTU_VAL(0)); - return cyc_to_sched_clock(&cd, cyc, (u32)~0); -} - -static void notrace nomadik_update_sched_clock(void) -{ - u32 cyc = -readl(mtu_base + MTU_VAL(0)); - update_sched_clock(&cd, cyc, (u32)~0); -} - /* Clockevent device: use one-shot mode */ static void nmdk_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev) @@ -172,15 +138,10 @@ void __init nmdk_timer_init(void) writel(0, mtu_base + MTU_BGLR(0)); writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0)); - /* Now the clock source is ready */ - nmdk_clksrc.read = nmdk_read_timer; - if (clocksource_register_hz(&nmdk_clksrc, rate)) pr_err("timer: failed to initialize clock source %s\n", nmdk_clksrc.name); - init_sched_clock(&cd, nomadik_update_sched_clock, 32, rate); - /* Timer 1 is used for events */ clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE);