diff options
Diffstat (limited to 'arch/arm/plat-mxc/pit.c')
-rw-r--r-- | arch/arm/plat-mxc/pit.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/arm/plat-mxc/pit.c b/arch/arm/plat-mxc/pit.c index 1e350b950b9f..30b581bef12e 100644 --- a/arch/arm/plat-mxc/pit.c +++ b/arch/arm/plat-mxc/pit.c @@ -92,14 +92,18 @@ static DEFINE_CLOCK_DATA(cd); static void __iomem *sched_clock_reg; unsigned long long notrace sched_clock(void) { - cycle_t cyc = sched_clock_reg ? ((u32)~0 - - __raw_readl(sched_clock_reg)) : 0; + cycle_t cyc = 0; + + if (sched_clock_reg) + cyc = pit_cnt + pit_cycle_per_jiffy - __raw_readl(sched_clock_reg); return cyc_to_sched_clock(&cd, cyc, (u32)~0); } static void notrace mvf_update_sched_clock(void) { - cycle_t cyc = sched_clock_reg ? __raw_readl(sched_clock_reg) : 0; + cycle_t cyc = sched_clock_reg ? (pit_cnt + pit_cycle_per_jiffy - + __raw_readl(sched_clock_reg)) : 0; + update_sched_clock(&cd, cyc, (u32)~0); } static int __init pit_clocksource_init(struct clk *timer_clk) |