Merge git://oss.sgi.com:8090/xfs/xfs-2.6
[linux-drm-fsl-dcu.git] / arch / arm / kernel / time.c
index 0c5a6091a93cbc7038eaad22c768a414ed9d4424..ee47c532e2108b0879bef642c3a5ee174891b581 100644 (file)
@@ -29,6 +29,8 @@
 #include <linux/timer.h>
 #include <linux/irq.h>
 
+#include <linux/mc146818rtc.h>
+
 #include <asm/leds.h>
 #include <asm/thread_info.h>
 #include <asm/mach/time.h>
@@ -76,13 +78,14 @@ static unsigned long dummy_gettimeoffset(void)
 #endif
 
 /*
- * Scheduler clock - returns current time in nanosec units.
- * This is the default implementation.  Sub-architecture
- * implementations can override this.
+ * An implementation of printk_clock() independent from
+ * sched_clock().  This avoids non-bootable kernels when
+ * printk_clock is enabled.
  */
-unsigned long long __attribute__((weak)) sched_clock(void)
+unsigned long long printk_clock(void)
 {
-       return (unsigned long long)jiffies * (1000000000 / HZ);
+       return (unsigned long long)(jiffies - INITIAL_JIFFIES) *
+                       (1000000000 / HZ);
 }
 
 static unsigned long next_rtc_update;
@@ -220,10 +223,10 @@ EXPORT_SYMBOL(leds_event);
 #ifdef CONFIG_LEDS_TIMER
 static inline void do_leds(void)
 {
-       static unsigned int count = 50;
+       static unsigned int count = HZ/2;
 
        if (--count == 0) {
-               count = 50;
+               count = HZ/2;
                leds_event(led_timer);
        }
 }