Merge branch 'master' into for_paulus
[linux-drm-fsl-dcu.git] / arch / arm26 / kernel / time.c
index 335525339ad6f4e107689ca26d047eb7b4a89330..0f1d57fbd3d7bea278fed6bf0ed3a20b0e7ce8d6 100644 (file)
@@ -18,7 +18,6 @@
  *              "A Kernel Model for Precision Timekeeping" by Dave Mills
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
@@ -34,8 +33,6 @@
 #include <asm/irq.h>
 #include <asm/ioc.h>
 
-extern unsigned long wall_jiffies;
-
 /* this needs a better home */
 DEFINE_SPINLOCK(rtc_lock);
 
@@ -92,14 +89,6 @@ static unsigned long gettimeoffset(void)
         return (offset + LATCH/2) / LATCH;
 }
 
-/*
- * Scheduler clock - returns current time in nanosec units.
- */
-unsigned long long sched_clock(void)
-{
-       return (unsigned long long)jiffies * (1000000000 / HZ);
-}
-
 static unsigned long next_rtc_update;
 
 /*
@@ -137,16 +126,11 @@ void do_gettimeofday(struct timeval *tv)
 {
        unsigned long flags;
        unsigned long seq;
-       unsigned long usec, sec, lost;
+       unsigned long usec, sec;
 
        do {
                seq = read_seqbegin_irqsave(&xtime_lock, flags);
                usec = gettimeoffset();
-
-               lost = jiffies - wall_jiffies;
-               if (lost)
-                       usec += lost * USECS_PER_JIFFY;
-
                sec = xtime.tv_sec;
                usec += xtime.tv_nsec / 1000;
        } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
@@ -175,8 +159,7 @@ int do_settimeofday(struct timespec *tv)
         * wall time.  Discover what correction gettimeofday() would have
         * done, and then undo it!
         */
-       tv->tv_nsec -= 1000 * (gettimeoffset() +
-                       (jiffies - wall_jiffies) * USECS_PER_JIFFY);
+       tv->tv_nsec -= 1000 * gettimeoffset();
 
        while (tv->tv_nsec < 0) {
                tv->tv_nsec += NSEC_PER_SEC;
@@ -195,7 +178,7 @@ EXPORT_SYMBOL(do_settimeofday);
 
 static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-        do_timer(regs);
+        do_timer(1);
 #ifndef CONFIG_SMP
        update_process_times(user_mode(regs));
 #endif
@@ -206,7 +189,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static struct irqaction timer_irq = {
        .name   = "timer",
-       .flags  = SA_INTERRUPT,
+       .flags  = IRQF_DISABLED,
        .handler = timer_interrupt,
 };