Merge branch 'stable-3.2' into pandora-3.2
[pandora-kernel.git] / kernel / hrtimer.c
index 6918c03..00ebf9a 100644 (file)
@@ -657,6 +657,7 @@ static int hrtimer_reprogram(struct hrtimer *timer,
 static inline void hrtimer_init_hres(struct hrtimer_cpu_base *base)
 {
        base->expires_next.tv64 = KTIME_MAX;
+       base->hang_detected = 0;
        base->hres_active = 0;
 }
 
@@ -1199,7 +1200,12 @@ static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
 
        cpu_base = &__raw_get_cpu_var(hrtimer_bases);
 
-       if (clock_id == CLOCK_REALTIME && mode != HRTIMER_MODE_ABS)
+       /*
+        * POSIX magic: Relative CLOCK_REALTIME timers are not affected by
+        * clock modifications, so they needs to become CLOCK_MONOTONIC to
+        * ensure POSIX compliance.
+        */
+       if (clock_id == CLOCK_REALTIME && mode & HRTIMER_MODE_REL)
                clock_id = CLOCK_MONOTONIC;
 
        base = hrtimer_clockid_to_base(clock_id);
@@ -1702,6 +1708,7 @@ static void __cpuinit init_hrtimers_cpu(int cpu)
                timerqueue_init_head(&cpu_base->clock_base[i].active);
        }
 
+       cpu_base->active_bases = 0;
        hrtimer_init_hres(cpu_base);
 }