From: Joe Jin Date: Tue, 28 Aug 2012 10:13:05 +0000 (+0800) Subject: Revert "3.0.x: hrtimer: Update hrtimer base offsets each hrtimer_interrupt" X-Git-Tag: v2.6.39-400.9.0~328 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=697d22d9724037fd9beff31188d97b867b90511e;p=users%2Fjedix%2Flinux-maple.git Revert "3.0.x: hrtimer: Update hrtimer base offsets each hrtimer_interrupt" This reverts commit 54b16ee687c86dfd6c94e49bdaa1535a3bf3cc9f. --- diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index f6b2a74bfc9f..fd0dc30c9f15 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -320,9 +320,6 @@ extern ktime_t ktime_get(void); extern ktime_t ktime_get_real(void); extern ktime_t ktime_get_boottime(void); extern ktime_t ktime_get_monotonic_offset(void); -extern void ktime_get_and_real_and_sleep_offset(ktime_t *monotonic, - ktime_t *real_offset, - ktime_t *sleep_offset); DECLARE_PER_CPU(struct tick_device, tick_cpu_device); diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 70e9951627c5..250b2b5205a3 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -1258,26 +1258,18 @@ static void __run_hrtimer(struct hrtimer *timer, ktime_t *now) void hrtimer_interrupt(struct clock_event_device *dev) { struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases); - ktime_t expires_next, now, entry_time, delta, real_offset, sleep_offset; + ktime_t expires_next, now, entry_time, delta; int i, retries = 0; BUG_ON(!cpu_base->hres_active); cpu_base->nr_events++; dev->next_event.tv64 = KTIME_MAX; - - ktime_get_and_real_and_sleep_offset(&now, &real_offset, &sleep_offset); - - entry_time = now; + entry_time = now = ktime_get(); retry: expires_next.tv64 = KTIME_MAX; raw_spin_lock(&cpu_base->lock); - - /* Update base offsets, to avoid early wakeups */ - cpu_base->clock_base[HRTIMER_BASE_REALTIME].offset = real_offset; - cpu_base->clock_base[HRTIMER_BASE_BOOTTIME].offset = sleep_offset; - /* * We set expires_next to KTIME_MAX here with cpu_base->lock * held to prevent that a timer is enqueued in our queue via @@ -1354,7 +1346,7 @@ retry: * interrupt routine. We give it 3 attempts to avoid * overreacting on some spurious event. */ - ktime_get_and_real_and_sleep_offset(&now, &real_offset, &sleep_offset); + now = ktime_get(); cpu_base->nr_retries++; if (++retries < 3) goto retry; diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 0f140a76f9e6..a3d79d26f0e7 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1107,40 +1107,6 @@ void get_xtime_and_monotonic_and_sleep_offset(struct timespec *xtim, } while (read_seqretry(&xtime_lock, seq)); } -/** - * ktime_get_and_real_and_sleep_offset() - hrtimer helper, gets monotonic ktime, - * realtime offset, and sleep offsets. - */ -void ktime_get_and_real_and_sleep_offset(ktime_t *monotonic, - ktime_t *real_offset, - ktime_t *sleep_offset) -{ - unsigned long seq; - struct timespec wtom, sleep; - u64 secs, nsecs; - - do { - seq = read_seqbegin(&xtime_lock); - - secs = xtime.tv_sec + - wall_to_monotonic.tv_sec; - nsecs = xtime.tv_nsec + - wall_to_monotonic.tv_nsec; - nsecs += timekeeping_get_ns(); - /* If arch requires, add in gettimeoffset() */ - nsecs += arch_gettimeoffset(); - - wtom = wall_to_monotonic; - sleep = total_sleep_time; - } while (read_seqretry(&xtime_lock, seq)); - - *monotonic = ktime_add_ns(ktime_set(secs, 0), nsecs); - set_normalized_timespec(&wtom, -wtom.tv_sec, -wtom.tv_nsec); - *real_offset = timespec_to_ktime(wtom); - *sleep_offset = timespec_to_ktime(sleep); -} - - /** * ktime_get_monotonic_offset() - get wall_to_monotonic in ktime_t format */