summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/kernel/sched_clock.c1
-rw-r--r--arch/arm/plat-mxc/pit.c10
2 files changed, 8 insertions, 3 deletions
diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
index 9a46370fe9da..a481272d7e8a 100644
--- a/arch/arm/kernel/sched_clock.c
+++ b/arch/arm/kernel/sched_clock.c
@@ -66,6 +66,7 @@ void __init init_sched_clock(struct clock_data *cd, void (*update)(void),
* Ensure that sched_clock() starts off at 0ns
*/
cd->epoch_ns = 0;
+ cd->epoch_cyc = 0;
}
void __init sched_clock_postinit(void)
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)