Merge branch 'timers-timekeeping-for-linus' of git://git.kernel.org/pub/scm/linux...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Aug 2010 20:18:29 +0000 (13:18 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Aug 2010 20:18:29 +0000 (13:18 -0700)
* 'timers-timekeeping-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  um: Fix read_persistent_clock fallout
  kgdb: Do not access xtime directly
  powerpc: Clean up obsolete code relating to decrementer and timebase
  powerpc: Rework VDSO gettimeofday to prevent time going backwards
  clocksource: Add __clocksource_updatefreq_hz/khz methods
  x86: Convert common clocksources to use clocksource_register_hz/khz
  timekeeping: Make xtime and wall_to_monotonic static
  hrtimer: Cleanup direct access to wall_to_monotonic
  um: Convert to use read_persistent_clock
  timkeeping: Fix update_vsyscall to provide wall_to_monotonic offset
  powerpc: Cleanup xtime usage
  powerpc: Simplify update_vsyscall
  time: Kill off CONFIG_GENERIC_TIME
  time: Implement timespec_add
  x86: Fix vtime/file timestamp inconsistencies

Trivial conflicts in Documentation/feature-removal-schedule.txt

Much less trivial conflicts in arch/powerpc/kernel/time.c resolved as
per Thomas' earlier merge commit 47916be4e28c ("Merge branch
'powerpc.cherry-picks' into timers/clocksource")

46 files changed:
Documentation/feature-removal-schedule.txt
Documentation/kernel-parameters.txt
arch/alpha/Kconfig
arch/arm/Kconfig
arch/avr32/Kconfig
arch/blackfin/Kconfig
arch/cris/Kconfig
arch/frv/Kconfig
arch/h8300/Kconfig
arch/ia64/Kconfig
arch/ia64/kernel/time.c
arch/m32r/Kconfig
arch/m68k/Kconfig
arch/m68knommu/Kconfig
arch/microblaze/Kconfig
arch/mips/Kconfig
arch/mn10300/Kconfig
arch/parisc/Kconfig
arch/powerpc/Kconfig
arch/powerpc/kernel/time.c
arch/s390/Kconfig
arch/s390/kernel/time.c
arch/score/Kconfig
arch/sh/Kconfig
arch/sparc/Kconfig
arch/um/Kconfig.common
arch/um/kernel/time.c
arch/x86/Kconfig
arch/x86/kernel/hpet.c
arch/x86/kernel/tsc.c
arch/x86/kernel/vsyscall_64.c
arch/xtensa/Kconfig
drivers/Makefile
drivers/acpi/acpi_pad.c
drivers/acpi/processor_idle.c
drivers/clocksource/acpi_pm.c
drivers/misc/Kconfig
include/linux/clocksource.h
include/linux/time.h
kernel/debug/kdb/kdb_main.c
kernel/hrtimer.c
kernel/time.c
kernel/time/Kconfig
kernel/time/clocksource.c
kernel/time/timekeeping.c
kernel/trace/Kconfig

index 6fdb837d940bac4ec64337c448f7d61f0b24e6a5..71f0fea1058f8d2b460596a8c8c15e18a275566d 100644 (file)
@@ -445,16 +445,6 @@ Who:       Jan Kiszka <jan.kiszka@web.de>
 
 ----------------------------
 
-What:  xtime, wall_to_monotonic
-When:  2.6.36+
-Files: kernel/time/timekeeping.c include/linux/time.h
-Why:   Cleaning up timekeeping internal values. Please use
-       existing timekeeping accessor functions to access
-       the equivalent functionality.
-Who:   John Stultz <johnstul@us.ibm.com>
-
-----------------------------
-
 What:  KVM paravirt mmu host support
 When:  January 2011
 Why:   The paravirt mmu host support is slower than non-paravirt mmu, both
index cbd4059305228a95a1c3a46399ecc7b861da1f77..71d286307cae64698e016e9ba3fbed79bcc3fdcd 100644 (file)
@@ -73,7 +73,6 @@ parameter is applicable:
        MTD     MTD (Memory Technology Device) support is enabled.
        NET     Appropriate network support is enabled.
        NUMA    NUMA support is enabled.
-       GENERIC_TIME The generic timeofday code is enabled.
        NFS     Appropriate NFS support is enabled.
        OSS     OSS sound support is enabled.
        PV_OPS  A paravirtualized kernel is enabled.
@@ -470,7 +469,7 @@ and is between 256 and 4096 characters. It is defined in the file
                        clocksource is not available, it defaults to PIT.
                        Format: { pit | tsc | cyclone | pmtmr }
 
-       clocksource=    [GENERIC_TIME] Override the default clocksource
+       clocksource=    Override the default clocksource
                        Format: <string>
                        Override the default clocksource and use the clocksource
                        with the name specified.
index 3e2e540a0f2a85ce92aa0a70f604bc4a461c3517..b9647bb66d1388d9c13503748252c2a1df4ac830 100644 (file)
@@ -47,10 +47,6 @@ config GENERIC_CALIBRATE_DELAY
        bool
        default y
 
-config GENERIC_TIME
-       bool
-       default y
-
 config GENERIC_CMOS_UPDATE
         def_bool y
 
index e39caa8b0c93e323c9c1e2feda7bb90fd1a3a4a1..9e10882c81d7746e06f0908cb5ce0198e2d2654d 100644 (file)
@@ -43,10 +43,6 @@ config SYS_SUPPORTS_APM_EMULATION
 config GENERIC_GPIO
        bool
 
-config GENERIC_TIME
-       bool
-       default y
-
 config ARCH_USES_GETTIMEOFFSET
        bool
        default n
index f2b3193331841b7ecec7263658de1590da42a9cc..f51572772e217d5ba9b674ffa2a5d68e5f13ca00 100644 (file)
@@ -45,9 +45,6 @@ config GENERIC_IRQ_PROBE
 config RWSEM_GENERIC_SPINLOCK
        def_bool y
 
-config GENERIC_TIME
-       def_bool y
-
 config GENERIC_CLOCKEVENTS
        def_bool y
 
index f66294b4f9d29d31fbec1075aabf3483be352309..c88fd3584122780dc32f8484901a7e38e460b988 100644 (file)
@@ -614,9 +614,6 @@ comment "Kernel Timer/Scheduler"
 
 source kernel/Kconfig.hz
 
-config GENERIC_TIME
-       def_bool y
-
 config GENERIC_CLOCKEVENTS
        bool "Generic clock events"
        default y
index e25bf4440b513d215ae183736268178143289b1d..887ef855be2a59c0a61f513cfeaafc2df72cd802 100644 (file)
@@ -20,9 +20,6 @@ config RWSEM_GENERIC_SPINLOCK
 config RWSEM_XCHGADD_ALGORITHM
        bool
 
-config GENERIC_TIME
-       def_bool y
-
 config GENERIC_CMOS_UPDATE
        def_bool y
 
index 4b5830bcbe2e21d25f7eca0f4395a7b54b354d07..16399bd249930c1a9e2e06f7d0da247b288b6d34 100644 (file)
@@ -40,10 +40,6 @@ config GENERIC_HARDIRQS_NO__DO_IRQ
        bool
        default y
 
-config GENERIC_TIME
-       bool
-       default y
-
 config TIME_LOW_RES
        bool
        default y
index 53cc669e6d591e94891753fcd375e47fe5e9173b..988b6ff34cc4df77caed6cff53d093ab841c31f0 100644 (file)
@@ -62,10 +62,6 @@ config GENERIC_CALIBRATE_DELAY
        bool
        default y
 
-config GENERIC_TIME
-       bool
-       default y
-
 config GENERIC_BUG
         bool
         depends on BUG
index 95610820041ea33bf76f9097fcab9d2312a475ea..8711d13cd79f3e1a354115b467b83c13c738ef02 100644 (file)
@@ -82,10 +82,6 @@ config GENERIC_CALIBRATE_DELAY
        bool
        default y
 
-config GENERIC_TIME
-       bool
-       default y
-
 config GENERIC_TIME_VSYSCALL
        bool
        default y
index 653b3c46ea82a86bb2e5092538bc5e094165a3f6..ed6f22eb5b12adcd647abb384a44ff55e4e14604 100644 (file)
@@ -471,7 +471,8 @@ void update_vsyscall_tz(void)
 {
 }
 
-void update_vsyscall(struct timespec *wall, struct clocksource *c, u32 mult)
+void update_vsyscall(struct timespec *wall, struct timespec *wtm,
+                       struct clocksource *c, u32 mult)
 {
         unsigned long flags;
 
@@ -487,9 +488,9 @@ void update_vsyscall(struct timespec *wall, struct clocksource *c, u32 mult)
        /* copy kernel time structures */
         fsyscall_gtod_data.wall_time.tv_sec = wall->tv_sec;
         fsyscall_gtod_data.wall_time.tv_nsec = wall->tv_nsec;
-        fsyscall_gtod_data.monotonic_time.tv_sec = wall_to_monotonic.tv_sec
+       fsyscall_gtod_data.monotonic_time.tv_sec = wtm->tv_sec
                                                        + wall->tv_sec;
-        fsyscall_gtod_data.monotonic_time.tv_nsec = wall_to_monotonic.tv_nsec
+       fsyscall_gtod_data.monotonic_time.tv_nsec = wtm->tv_nsec
                                                        + wall->tv_nsec;
 
        /* normalize */
index 3a9319f93e89cdad744622eef5e2bed2aa2b3be7..836abbbc9c04c421ab3d6f4c7d433ed231e90f04 100644 (file)
@@ -44,9 +44,6 @@ config HZ
        int
        default 100
 
-config GENERIC_TIME
-       def_bool y
-
 config ARCH_USES_GETTIMEOFFSET
        def_bool y
 
index 2e3737b92ffca3e36d0005317feee1d38dee526e..8030e2481d9758352a5c952bb34fc9715e330cc7 100644 (file)
@@ -59,9 +59,6 @@ config HZ
        int
        default 100
 
-config GENERIC_TIME
-       def_bool y
-
 config ARCH_USES_GETTIMEOFFSET
        def_bool y
 
index efeb6033fc1701621b418c4af5bd5046bd7bacaf..2609c394e1dfd11f6ea78c16c109cfac03c66836 100644 (file)
@@ -63,10 +63,6 @@ config GENERIC_CALIBRATE_DELAY
        bool
        default y
 
-config GENERIC_TIME
-       bool
-       default y
-
 config GENERIC_CMOS_UPDATE
        bool
        default y
index 9bd64b4b2b0c564fefd26d8d87937d8244d29e7c..692fdfce2a2357122119429ceb36779f13640560 100644 (file)
@@ -51,9 +51,6 @@ config GENERIC_IRQ_PROBE
 config GENERIC_CALIBRATE_DELAY
        def_bool y
 
-config GENERIC_TIME
-       def_bool y
-
 config GENERIC_TIME_VSYSCALL
        def_bool n
 
index 36642df7d5f6117ed0d8d8fd1c991a3237ddb8b9..3ad59dde485209bce858c425e4fc8a2f64b04c09 100644 (file)
@@ -758,10 +758,6 @@ config GENERIC_CLOCKEVENTS
        bool
        default y
 
-config GENERIC_TIME
-       bool
-       default y
-
 config GENERIC_CMOS_UPDATE
        bool
        default y
index 1c4565a9102b269802129324f1b322eb8834cbbf..444b9f918fdf8f2d5dec64b9827d8d746bb1ade1 100644 (file)
@@ -46,9 +46,6 @@ config GENERIC_FIND_NEXT_BIT
 config GENERIC_HWEIGHT
        def_bool y
 
-config GENERIC_TIME
-       def_bool y
-
 config GENERIC_BUG
        def_bool y
 
index 05a366a5c4d5c28431d3910aa69d993e7372e737..907417d187e15039bb4bb6d96075cd950a045dbd 100644 (file)
@@ -66,10 +66,6 @@ config GENERIC_CALIBRATE_DELAY
        bool
        default y
 
-config GENERIC_TIME
-       bool
-       default y
-
 config TIME_LOW_RES
        bool
        depends on SMP
index e2bf40a2ce5ac6d44be54bb3cc0e7b9b4d44e289..631e5a0fb6abcf2e124f0dfc6d1ed95d9b9f4566 100644 (file)
@@ -29,9 +29,6 @@ config MMU
 config GENERIC_CMOS_UPDATE
        def_bool y
 
-config GENERIC_TIME
-       def_bool y
-
 config GENERIC_TIME_VSYSCALL
        def_bool y
 
index ccb8759c8532e6955a0b5c1f05d2e3cdd83fee0b..ce53dfa7130dfc74f551c2360746f206154cf925 100644 (file)
@@ -796,10 +796,30 @@ static cycle_t timebase_read(struct clocksource *cs)
        return (cycle_t)get_tb();
 }
 
-static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec,
-                              u64 new_tb_to_xs, struct timespec *now,
-                              u32 frac_sec)
+void update_vsyscall(struct timespec *wall_time, struct timespec *wtm,
+                       struct clocksource *clock, u32 mult)
 {
+       u64 new_tb_to_xs, new_stamp_xsec;
+       u32 frac_sec;
+
+       if (clock != &clocksource_timebase)
+               return;
+
+       /* Make userspace gettimeofday spin until we're done. */
+       ++vdso_data->tb_update_count;
+       smp_mb();
+
+       /* XXX this assumes clock->shift == 22 */
+       /* 4611686018 ~= 2^(20+64-22) / 1e9 */
+       new_tb_to_xs = (u64) mult * 4611686018ULL;
+       new_stamp_xsec = (u64) wall_time->tv_nsec * XSEC_PER_SEC;
+       do_div(new_stamp_xsec, 1000000000);
+       new_stamp_xsec += (u64) wall_time->tv_sec * XSEC_PER_SEC;
+
+       BUG_ON(wall_time->tv_nsec >= NSEC_PER_SEC);
+       /* this is tv_nsec / 1e9 as a 0.32 fraction */
+       frac_sec = ((u64) wall_time->tv_nsec * 18446744073ULL) >> 32;
+
        /*
         * tb_update_count is used to allow the userspace gettimeofday code
         * to assure itself that it sees a consistent view of the tb_to_xs and
@@ -811,43 +831,17 @@ static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec,
         * We expect the caller to have done the first increment of
         * vdso_data->tb_update_count already.
         */
-       vdso_data->tb_orig_stamp = new_tb_stamp;
+       vdso_data->tb_orig_stamp = clock->cycle_last;
        vdso_data->stamp_xsec = new_stamp_xsec;
        vdso_data->tb_to_xs = new_tb_to_xs;
-       vdso_data->wtom_clock_sec = wall_to_monotonic.tv_sec;
-       vdso_data->wtom_clock_nsec = wall_to_monotonic.tv_nsec;
-       vdso_data->stamp_xtime = *now;
+       vdso_data->wtom_clock_sec = wtm->tv_sec;
+       vdso_data->wtom_clock_nsec = wtm->tv_nsec;
+       vdso_data->stamp_xtime = *wall_time;
        vdso_data->stamp_sec_fraction = frac_sec;
        smp_wmb();
        ++(vdso_data->tb_update_count);
 }
 
-void update_vsyscall(struct timespec *wall_time, struct clocksource *clock,
-                    u32 mult)
-{
-       u64 t2x, stamp_xsec;
-       u32 frac_sec;
-
-       if (clock != &clocksource_timebase)
-               return;
-
-       /* Make userspace gettimeofday spin until we're done. */
-       ++vdso_data->tb_update_count;
-       smp_mb();
-
-       /* XXX this assumes clock->shift == 22 */
-       /* 4611686018 ~= 2^(20+64-22) / 1e9 */
-       t2x = (u64) mult * 4611686018ULL;
-       stamp_xsec = (u64) wall_time->tv_nsec * XSEC_PER_SEC;
-       do_div(stamp_xsec, 1000000000);
-       stamp_xsec += (u64) wall_time->tv_sec * XSEC_PER_SEC;
-
-       BUG_ON(wall_time->tv_nsec >= NSEC_PER_SEC);
-       /* this is tv_nsec / 1e9 as a 0.32 fraction */
-       frac_sec = ((u64) wall_time->tv_nsec * 18446744073ULL) >> 32;
-       update_gtod(clock->cycle_last, stamp_xsec, t2x, wall_time, frac_sec);
-}
-
 void update_vsyscall_tz(void)
 {
        /* Make userspace gettimeofday spin until we're done. */
index bee1c0f794cf0262b00032493c0b79426d1730e9..f0777a47e3a531c17156a76694648aaf89cacd44 100644 (file)
@@ -40,9 +40,6 @@ config ARCH_HAS_ILOG2_U64
 config GENERIC_HWEIGHT
        def_bool y
 
-config GENERIC_TIME
-       def_bool y
-
 config GENERIC_TIME_VSYSCALL
        def_bool y
 
index 15a7536452d508b7998d37d9b679f4545d670dc1..2896cac9c14a9cd5501067e36f254c308b27cee8 100644 (file)
@@ -207,8 +207,8 @@ struct clocksource * __init clocksource_default_clock(void)
        return &clocksource_tod;
 }
 
-void update_vsyscall(struct timespec *wall_time, struct clocksource *clock,
-                    u32 mult)
+void update_vsyscall(struct timespec *wall_time, struct timespec *wtm,
+                       struct clocksource *clock, u32 mult)
 {
        if (clock != &clocksource_tod)
                return;
@@ -219,8 +219,8 @@ void update_vsyscall(struct timespec *wall_time, struct clocksource *clock,
        vdso_data->xtime_tod_stamp = clock->cycle_last;
        vdso_data->xtime_clock_sec = wall_time->tv_sec;
        vdso_data->xtime_clock_nsec = wall_time->tv_nsec;
-       vdso_data->wtom_clock_sec = wall_to_monotonic.tv_sec;
-       vdso_data->wtom_clock_nsec = wall_to_monotonic.tv_nsec;
+       vdso_data->wtom_clock_sec = wtm->tv_sec;
+       vdso_data->wtom_clock_nsec = wtm->tv_nsec;
        vdso_data->ntp_mult = mult;
        smp_wmb();
        ++vdso_data->tb_update_count;
index 55d413e6dcf2731976cf36de4fd878fc6e57effe..be4a155847519e04ce20ee8f5cfce309493b3b83 100644 (file)
@@ -55,9 +55,6 @@ config GENERIC_CALIBRATE_DELAY
 config GENERIC_CLOCKEVENTS
        def_bool y
 
-config GENERIC_TIME
-       def_bool y
-
 config SCHED_NO_NO_OMIT_FRAME_POINTER
        def_bool y
 
index 82868fee21fdbed9f670edde147032253f82f459..33990fa95af013a64e081c4bfc411f58228f64cb 100644 (file)
@@ -98,9 +98,6 @@ config GENERIC_CALIBRATE_DELAY
 config GENERIC_IOMAP
        bool
 
-config GENERIC_TIME
-       def_bool y
-
 config GENERIC_CLOCKEVENTS
        def_bool y
 
index ba068c833e5d83f4399cb229e687fe553d5e33fc..491e9d6de1912d56cea2b21f51bf8cfd7980e278 100644 (file)
@@ -67,9 +67,6 @@ config BITS
        default 32 if SPARC32
        default 64 if SPARC64
 
-config GENERIC_TIME
-       def_bool y
-
 config ARCH_USES_GETTIMEOFFSET
        bool
        default y if SPARC32
index 0d207e73a75821df92dfc443c546530650a43e96..7c8e277f6d342a295d37bad076a6fb61588dbae6 100644 (file)
@@ -55,10 +55,6 @@ config GENERIC_BUG
        default y
        depends on BUG
 
-config GENERIC_TIME
-       bool
-       default y
-
 config GENERIC_CLOCKEVENTS
        bool
        default y
index c8b9c469fcd7995822d7a25c02be9fe2e0d45e4e..a08d9fab81f2025c008c23e8b4ed229ff6c65525 100644 (file)
@@ -102,16 +102,16 @@ static void __init setup_itimer(void)
        clockevents_register_device(&itimer_clockevent);
 }
 
-void __init time_init(void)
+void read_persistent_clock(struct timespec *ts)
 {
-       long long nsecs;
-
-       timer_init();
+       long long nsecs = os_nsecs();
 
-       nsecs = os_nsecs();
-       set_normalized_timespec(&wall_to_monotonic, -nsecs / NSEC_PER_SEC,
-                               -nsecs % NSEC_PER_SEC);
-       set_normalized_timespec(&xtime, nsecs / NSEC_PER_SEC,
+       set_normalized_timespec(ts, nsecs / NSEC_PER_SEC,
                                nsecs % NSEC_PER_SEC);
+}
+
+void __init time_init(void)
+{
+       timer_init();
        late_time_init = setup_itimer;
 }
index 6f77afa6bca92203a338badf7e25a3fe01ab4e57..baa34e5102222f29cb1f3741e051f75ffdf67a45 100644 (file)
@@ -73,9 +73,6 @@ config ARCH_DEFCONFIG
        default "arch/x86/configs/i386_defconfig" if X86_32
        default "arch/x86/configs/x86_64_defconfig" if X86_64
 
-config GENERIC_TIME
-       def_bool y
-
 config GENERIC_CMOS_UPDATE
        def_bool y
 
@@ -2047,7 +2044,7 @@ config SCx200
 
 config SCx200HR_TIMER
        tristate "NatSemi SCx200 27MHz High-Resolution Timer Support"
-       depends on SCx200 && GENERIC_TIME
+       depends on SCx200
        default y
        ---help---
          This driver provides a clocksource built upon the on-chip
index ba390d731175a492686643dd873786eafda9521b..33dbcc4ec5ff285435c7c184be50e485c58a9ca2 100644 (file)
@@ -16,7 +16,6 @@
 #include <asm/hpet.h>
 
 #define HPET_MASK                      CLOCKSOURCE_MASK(32)
-#define HPET_SHIFT                     22
 
 /* FSEC = 10^-15
    NSEC = 10^-9 */
@@ -787,7 +786,6 @@ static struct clocksource clocksource_hpet = {
        .rating         = 250,
        .read           = read_hpet,
        .mask           = HPET_MASK,
-       .shift          = HPET_SHIFT,
        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
        .resume         = hpet_resume_counter,
 #ifdef CONFIG_X86_64
@@ -798,6 +796,7 @@ static struct clocksource clocksource_hpet = {
 static int hpet_clocksource_register(void)
 {
        u64 start, now;
+       u64 hpet_freq;
        cycle_t t1;
 
        /* Start the counter */
@@ -832,9 +831,15 @@ static int hpet_clocksource_register(void)
         *  mult = (hpet_period * 2^shift)/10^6
         *  mult = (hpet_period << shift)/FSEC_PER_NSEC
         */
-       clocksource_hpet.mult = div_sc(hpet_period, FSEC_PER_NSEC, HPET_SHIFT);
 
-       clocksource_register(&clocksource_hpet);
+       /* Need to convert hpet_period (fsec/cyc) to cyc/sec:
+        *
+        * cyc/sec = FSEC_PER_SEC/hpet_period(fsec/cyc)
+        * cyc/sec = (FSEC_PER_NSEC * NSEC_PER_SEC)/hpet_period
+        */
+       hpet_freq = FSEC_PER_NSEC * NSEC_PER_SEC;
+       do_div(hpet_freq, hpet_period);
+       clocksource_register_hz(&clocksource_hpet, (u32)hpet_freq);
 
        return 0;
 }
index 9faf91ae1841e3530f611b136ad058a0efbcfa67..ce8e50239332470ba329dd3045692fee42f69a16 100644 (file)
@@ -751,7 +751,6 @@ static struct clocksource clocksource_tsc = {
        .read                   = read_tsc,
        .resume                 = resume_tsc,
        .mask                   = CLOCKSOURCE_MASK(64),
-       .shift                  = 22,
        .flags                  = CLOCK_SOURCE_IS_CONTINUOUS |
                                  CLOCK_SOURCE_MUST_VERIFY,
 #ifdef CONFIG_X86_64
@@ -845,8 +844,6 @@ __cpuinit int unsynchronized_tsc(void)
 
 static void __init init_tsc_clocksource(void)
 {
-       clocksource_tsc.mult = clocksource_khz2mult(tsc_khz,
-                       clocksource_tsc.shift);
        if (tsc_clocksource_reliable)
                clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY;
        /* lower the rating if we already know its unstable: */
@@ -854,7 +851,7 @@ static void __init init_tsc_clocksource(void)
                clocksource_tsc.rating = 0;
                clocksource_tsc.flags &= ~CLOCK_SOURCE_IS_CONTINUOUS;
        }
-       clocksource_register(&clocksource_tsc);
+       clocksource_register_khz(&clocksource_tsc, tsc_khz);
 }
 
 #ifdef CONFIG_X86_64
index 1c0c6ab9c60f03394af20e57b3a09186a6cba57d..dcbb28c4b69461723147e2b863919301083b68b5 100644 (file)
@@ -73,8 +73,8 @@ void update_vsyscall_tz(void)
        write_sequnlock_irqrestore(&vsyscall_gtod_data.lock, flags);
 }
 
-void update_vsyscall(struct timespec *wall_time, struct clocksource *clock,
-                    u32 mult)
+void update_vsyscall(struct timespec *wall_time, struct timespec *wtm,
+                       struct clocksource *clock, u32 mult)
 {
        unsigned long flags;
 
@@ -87,7 +87,7 @@ void update_vsyscall(struct timespec *wall_time, struct clocksource *clock,
        vsyscall_gtod_data.clock.shift = clock->shift;
        vsyscall_gtod_data.wall_time_sec = wall_time->tv_sec;
        vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec;
-       vsyscall_gtod_data.wall_to_monotonic = wall_to_monotonic;
+       vsyscall_gtod_data.wall_to_monotonic = *wtm;
        vsyscall_gtod_data.wall_time_coarse = __current_kernel_time();
        write_sequnlock_irqrestore(&vsyscall_gtod_data.lock, flags);
 }
@@ -169,13 +169,18 @@ int __vsyscall(0) vgettimeofday(struct timeval * tv, struct timezone * tz)
  * unlikely */
 time_t __vsyscall(1) vtime(time_t *t)
 {
-       struct timeval tv;
+       unsigned seq;
        time_t result;
        if (unlikely(!__vsyscall_gtod_data.sysctl_enabled))
                return time_syscall(t);
 
-       vgettimeofday(&tv, NULL);
-       result = tv.tv_sec;
+       do {
+               seq = read_seqbegin(&__vsyscall_gtod_data.lock);
+
+               result = __vsyscall_gtod_data.wall_time_sec;
+
+       } while (read_seqretry(&__vsyscall_gtod_data.lock, seq));
+
        if (t)
                *t = result;
        return result;
index ebe228d02b08d6265723306b970a7fd338c5f9ec..0859bfd8ae93382909420ff1c2076fb170a46469 100644 (file)
@@ -48,9 +48,6 @@ config HZ
        int
        default 100
 
-config GENERIC_TIME
-       def_bool y
-
 source "init/Kconfig"
 source "kernel/Kconfig.freezer"
 
index 91874e048552364280d7905aa817e957be2f9c48..ae473445ad6daf11254ee269c3194c9ed03e0cb1 100644 (file)
@@ -101,7 +101,9 @@ obj-y                               += firmware/
 obj-$(CONFIG_CRYPTO)           += crypto/
 obj-$(CONFIG_SUPERH)           += sh/
 obj-$(CONFIG_ARCH_SHMOBILE)    += sh/
-obj-$(CONFIG_GENERIC_TIME)     += clocksource/
+ifndef CONFIG_ARCH_USES_GETTIMEOFFSET
+obj-y                          += clocksource/
+endif
 obj-$(CONFIG_DMA_ENGINE)       += dma/
 obj-$(CONFIG_DCA)              += dca/
 obj-$(CONFIG_HID)              += hid/
index 446aced33aff81d7a2c4a949abce8979006db720..b76848c80be34729c56bd20d04f75f9f534cbb36 100644 (file)
@@ -77,7 +77,7 @@ static void power_saving_mwait_init(void)
        power_saving_mwait_eax = (highest_cstate << MWAIT_SUBSTATE_SIZE) |
                (highest_subcstate - 1);
 
-#if defined(CONFIG_GENERIC_TIME) && defined(CONFIG_X86)
+#if defined(CONFIG_X86)
        switch (boot_cpu_data.x86_vendor) {
        case X86_VENDOR_AMD:
        case X86_VENDOR_INTEL:
index eead3f581fb50942ba8e9534d4e134a028d17533..b4c2f3bdadebc9ad6b23ce3ea1d2a8114b5c022f 100644 (file)
@@ -264,7 +264,7 @@ int acpi_processor_resume(struct acpi_device * device)
        return 0;
 }
 
-#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
+#if defined(CONFIG_X86)
 static void tsc_check_state(int state)
 {
        switch (boot_cpu_data.x86_vendor) {
index 72a633a6ec982e74153235e8f015ddba65d84af4..cfb0f5278415a2d371f2a6902ec0670183f6bc10 100644 (file)
@@ -68,10 +68,7 @@ static struct clocksource clocksource_acpi_pm = {
        .rating         = 200,
        .read           = acpi_pm_read,
        .mask           = (cycle_t)ACPI_PM_MASK,
-       .mult           = 0, /*to be calculated*/
-       .shift          = 22,
        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
-
 };
 
 
@@ -190,9 +187,6 @@ static int __init init_acpi_pm_clocksource(void)
        if (!pmtmr_ioport)
                return -ENODEV;
 
-       clocksource_acpi_pm.mult = clocksource_hz2mult(PMTMR_TICKS_PER_SEC,
-                                               clocksource_acpi_pm.shift);
-
        /* "verify" this timing source: */
        for (j = 0; j < ACPI_PM_MONOTONICITY_CHECKS; j++) {
                udelay(100 * j);
@@ -220,7 +214,8 @@ static int __init init_acpi_pm_clocksource(void)
        if (verify_pmtmr_rate() != 0)
                return -ENODEV;
 
-       return clocksource_register(&clocksource_acpi_pm);
+       return clocksource_register_hz(&clocksource_acpi_pm,
+                                               PMTMR_TICKS_PER_SEC);
 }
 
 /* We use fs_initcall because we want the PCI fixups to have run
index 9b089dfb173ef987f5220d38bce0336c66b92a0f..488f25472291feafbb12ca00e9ce3ecc4635281e 100644 (file)
@@ -72,7 +72,7 @@ config ATMEL_TCLIB
 
 config ATMEL_TCB_CLKSRC
        bool "TC Block Clocksource"
-       depends on ATMEL_TCLIB && GENERIC_TIME
+       depends on ATMEL_TCLIB
        default y
        help
          Select this to get a high precision clocksource based on a
@@ -240,7 +240,7 @@ config CS5535_MFGPT_DEFAULT_IRQ
 
 config CS5535_CLOCK_EVENT_SRC
        tristate "CS5535/CS5536 high-res timer (MFGPT) events"
-       depends on GENERIC_TIME && GENERIC_CLOCKEVENTS && CS5535_MFGPT
+       depends on GENERIC_CLOCKEVENTS && CS5535_MFGPT
        help
          This driver provides a clock event source based on the MFGPT
          timer(s) in the CS5535 and CS5536 companion chips.
index 5ea3c60c160c2df2d6e0010a33d9c8e01281b1f9..c37b21ad5a3b5c16dcc6c838ce0cb652682362f2 100644 (file)
@@ -292,6 +292,8 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec);
  */
 extern int
 __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq);
+extern void
+__clocksource_updatefreq_scale(struct clocksource *cs, u32 scale, u32 freq);
 
 static inline int clocksource_register_hz(struct clocksource *cs, u32 hz)
 {
@@ -303,6 +305,15 @@ static inline int clocksource_register_khz(struct clocksource *cs, u32 khz)
        return __clocksource_register_scale(cs, 1000, khz);
 }
 
+static inline void __clocksource_updatefreq_hz(struct clocksource *cs, u32 hz)
+{
+       __clocksource_updatefreq_scale(cs, 1, hz);
+}
+
+static inline void __clocksource_updatefreq_khz(struct clocksource *cs, u32 khz)
+{
+       __clocksource_updatefreq_scale(cs, 1000, khz);
+}
 
 static inline void
 clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec)
@@ -313,11 +324,13 @@ clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec)
 
 #ifdef CONFIG_GENERIC_TIME_VSYSCALL
 extern void
-update_vsyscall(struct timespec *ts, struct clocksource *c, u32 mult);
+update_vsyscall(struct timespec *ts, struct timespec *wtm,
+                       struct clocksource *c, u32 mult);
 extern void update_vsyscall_tz(void);
 #else
 static inline void
-update_vsyscall(struct timespec *ts, struct clocksource *c, u32 mult)
+update_vsyscall(struct timespec *ts, struct timespec *wtm,
+                       struct clocksource *c, u32 mult)
 {
 }
 
index ea3559f0b3f2cbac7e0373f51df471c133c23479..cb34e35fabac091f927184b786b0e3dd4550b3f7 100644 (file)
@@ -76,9 +76,25 @@ extern unsigned long mktime(const unsigned int year, const unsigned int mon,
                            const unsigned int min, const unsigned int sec);
 
 extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec);
+
+/*
+ * timespec_add_safe assumes both values are positive and checks
+ * for overflow. It will return TIME_T_MAX if the reutrn would be
+ * smaller then either of the arguments.
+ */
 extern struct timespec timespec_add_safe(const struct timespec lhs,
                                         const struct timespec rhs);
 
+
+static inline struct timespec timespec_add(struct timespec lhs,
+                                               struct timespec rhs)
+{
+       struct timespec ts_delta;
+       set_normalized_timespec(&ts_delta, lhs.tv_sec + rhs.tv_sec,
+                               lhs.tv_nsec + rhs.tv_nsec);
+       return ts_delta;
+}
+
 /*
  * sub = lhs - rhs, in normalized form
  */
@@ -97,8 +113,6 @@ static inline struct timespec timespec_sub(struct timespec lhs,
 #define timespec_valid(ts) \
        (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC))
 
-extern struct timespec xtime;
-extern struct timespec wall_to_monotonic;
 extern seqlock_t xtime_lock;
 
 extern void read_persistent_clock(struct timespec *ts);
@@ -110,7 +124,8 @@ extern int timekeeping_suspended;
 
 unsigned long get_seconds(void);
 struct timespec current_kernel_time(void);
-struct timespec __current_kernel_time(void); /* does not hold xtime_lock */
+struct timespec __current_kernel_time(void); /* does not take xtime_lock */
+struct timespec __get_wall_to_monotonic(void); /* does not take xtime_lock */
 struct timespec get_monotonic_coarse(void);
 
 #define CURRENT_TIME           (current_kernel_time())
index 8577e45a9a58472983c8f8fdaa5c397ee4c49e2a..28b844118bbd9d27f1e6bede2fd2502c6fd4f1b8 100644 (file)
@@ -2548,6 +2548,7 @@ static void kdb_sysinfo(struct sysinfo *val)
  */
 static int kdb_summary(int argc, const char **argv)
 {
+       struct timespec now;
        struct kdb_tm tm;
        struct sysinfo val;
 
@@ -2562,7 +2563,8 @@ static int kdb_summary(int argc, const char **argv)
        kdb_printf("domainname %s\n", init_uts_ns.name.domainname);
        kdb_printf("ccversion  %s\n", __stringify(CCVERSION));
 
-       kdb_gmtime(&xtime, &tm);
+       now = __current_kernel_time();
+       kdb_gmtime(&now, &tm);
        kdb_printf("date       %04d-%02d-%02d %02d:%02d:%02d "
                   "tz_minuteswest %d\n",
                1900+tm.tm_year, tm.tm_mon+1, tm.tm_mday,
index e934339fbbef1cb6acdfb17899e50e539059d0b4..ce669174f355c7dd1e1893903bb4d18a25f17c34 100644 (file)
@@ -90,7 +90,7 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base)
        do {
                seq = read_seqbegin(&xtime_lock);
                xts = __current_kernel_time();
-               tom = wall_to_monotonic;
+               tom = __get_wall_to_monotonic();
        } while (read_seqretry(&xtime_lock, seq));
 
        xtim = timespec_to_ktime(xts);
@@ -608,7 +608,7 @@ static int hrtimer_reprogram(struct hrtimer *timer,
 static void retrigger_next_event(void *arg)
 {
        struct hrtimer_cpu_base *base;
-       struct timespec realtime_offset;
+       struct timespec realtime_offset, wtm;
        unsigned long seq;
 
        if (!hrtimer_hres_active())
@@ -616,10 +616,9 @@ static void retrigger_next_event(void *arg)
 
        do {
                seq = read_seqbegin(&xtime_lock);
-               set_normalized_timespec(&realtime_offset,
-                                       -wall_to_monotonic.tv_sec,
-                                       -wall_to_monotonic.tv_nsec);
+               wtm = __get_wall_to_monotonic();
        } while (read_seqretry(&xtime_lock, seq));
+       set_normalized_timespec(&realtime_offset, -wtm.tv_sec, -wtm.tv_nsec);
 
        base = &__get_cpu_var(hrtimer_bases);
 
index 848b1c2ab09a411858c8bef030ecdfc61b8017e8..ba9b338d1835e071273d8f8f8d2a054ab9c95790 100644 (file)
@@ -300,22 +300,6 @@ struct timespec timespec_trunc(struct timespec t, unsigned gran)
 }
 EXPORT_SYMBOL(timespec_trunc);
 
-#ifndef CONFIG_GENERIC_TIME
-/*
- * Simulate gettimeofday using do_gettimeofday which only allows a timeval
- * and therefore only yields usec accuracy
- */
-void getnstimeofday(struct timespec *tv)
-{
-       struct timeval x;
-
-       do_gettimeofday(&x);
-       tv->tv_sec = x.tv_sec;
-       tv->tv_nsec = x.tv_usec * NSEC_PER_USEC;
-}
-EXPORT_SYMBOL_GPL(getnstimeofday);
-#endif
-
 /* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
  * Assumes input in normal date format, i.e. 1980-12-31 23:59:59
  * => year=1980, mon=12, day=31, hour=23, min=59, sec=59.
index 95ed42951e0adb536db3783b5d026914ddfdbc73..f06a8a3656481d7e3120ed074a1b16c04357a9dd 100644 (file)
@@ -6,7 +6,7 @@ config TICK_ONESHOT
 
 config NO_HZ
        bool "Tickless System (Dynamic Ticks)"
-       depends on GENERIC_TIME && GENERIC_CLOCKEVENTS
+       depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
        select TICK_ONESHOT
        help
          This option enables a tickless system: timer interrupts will
@@ -15,7 +15,7 @@ config NO_HZ
 
 config HIGH_RES_TIMERS
        bool "High Resolution Timer Support"
-       depends on GENERIC_TIME && GENERIC_CLOCKEVENTS
+       depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
        select TICK_ONESHOT
        help
          This option enables high resolution timer support. If your
index f08e99c1d5617252aa909cd457f0310bd67a0f6b..c18d7efa1b4b10b0146466094016d74a69702c30 100644 (file)
@@ -531,7 +531,7 @@ static u64 clocksource_max_deferment(struct clocksource *cs)
        return max_nsecs - (max_nsecs >> 5);
 }
 
-#ifdef CONFIG_GENERIC_TIME
+#ifndef CONFIG_ARCH_USES_GETTIMEOFFSET
 
 /**
  * clocksource_select - Select the best clocksource available
@@ -577,7 +577,7 @@ static void clocksource_select(void)
        }
 }
 
-#else /* CONFIG_GENERIC_TIME */
+#else /* !CONFIG_ARCH_USES_GETTIMEOFFSET */
 
 static inline void clocksource_select(void) { }
 
@@ -639,19 +639,18 @@ static void clocksource_enqueue(struct clocksource *cs)
 #define MAX_UPDATE_LENGTH 5 /* Seconds */
 
 /**
- * __clocksource_register_scale - Used to install new clocksources
+ * __clocksource_updatefreq_scale - Used update clocksource with new freq
  * @t:         clocksource to be registered
  * @scale:     Scale factor multiplied against freq to get clocksource hz
  * @freq:      clocksource frequency (cycles per second) divided by scale
  *
- * Returns -EBUSY if registration fails, zero otherwise.
+ * This should only be called from the clocksource->enable() method.
  *
  * This *SHOULD NOT* be called directly! Please use the
- * clocksource_register_hz() or clocksource_register_khz helper functions.
+ * clocksource_updatefreq_hz() or clocksource_updatefreq_khz helper functions.
  */
-int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
+void __clocksource_updatefreq_scale(struct clocksource *cs, u32 scale, u32 freq)
 {
-
        /*
         * Ideally we want to use  some of the limits used in
         * clocksource_max_deferment, to provide a more informed
@@ -662,7 +661,27 @@ int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
                                      NSEC_PER_SEC/scale,
                                      MAX_UPDATE_LENGTH*scale);
        cs->max_idle_ns = clocksource_max_deferment(cs);
+}
+EXPORT_SYMBOL_GPL(__clocksource_updatefreq_scale);
+
+/**
+ * __clocksource_register_scale - Used to install new clocksources
+ * @t:         clocksource to be registered
+ * @scale:     Scale factor multiplied against freq to get clocksource hz
+ * @freq:      clocksource frequency (cycles per second) divided by scale
+ *
+ * Returns -EBUSY if registration fails, zero otherwise.
+ *
+ * This *SHOULD NOT* be called directly! Please use the
+ * clocksource_register_hz() or clocksource_register_khz helper functions.
+ */
+int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
+{
+
+       /* Intialize mult/shift and max_idle_ns */
+       __clocksource_updatefreq_scale(cs, scale, freq);
 
+       /* Add clocksource to the clcoksource list */
        mutex_lock(&clocksource_mutex);
        clocksource_enqueue(cs);
        clocksource_select();
index caf8d4d4f5c873dffbbc124c62cff08d84a0eb0d..e14c839e9faa7ab212d805ea41ffaa16667abc23 100644 (file)
@@ -153,8 +153,8 @@ __cacheline_aligned_in_smp DEFINE_SEQLOCK(xtime_lock);
  * - wall_to_monotonic is no longer the boot time, getboottime must be
  * used instead.
  */
-struct timespec xtime __attribute__ ((aligned (16)));
-struct timespec wall_to_monotonic __attribute__ ((aligned (16)));
+static struct timespec xtime __attribute__ ((aligned (16)));
+static struct timespec wall_to_monotonic __attribute__ ((aligned (16)));
 static struct timespec total_sleep_time;
 
 /*
@@ -170,11 +170,10 @@ void timekeeping_leap_insert(int leapsecond)
 {
        xtime.tv_sec += leapsecond;
        wall_to_monotonic.tv_sec -= leapsecond;
-       update_vsyscall(&xtime, timekeeper.clock, timekeeper.mult);
+       update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock,
+                       timekeeper.mult);
 }
 
-#ifdef CONFIG_GENERIC_TIME
-
 /**
  * timekeeping_forward_now - update clock to the current time
  *
@@ -328,7 +327,8 @@ int do_settimeofday(struct timespec *tv)
        timekeeper.ntp_error = 0;
        ntp_clear();
 
-       update_vsyscall(&xtime, timekeeper.clock, timekeeper.mult);
+       update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock,
+                               timekeeper.mult);
 
        write_sequnlock_irqrestore(&xtime_lock, flags);
 
@@ -376,52 +376,6 @@ void timekeeping_notify(struct clocksource *clock)
        tick_clock_notify();
 }
 
-#else /* GENERIC_TIME */
-
-static inline void timekeeping_forward_now(void) { }
-
-/**
- * ktime_get - get the monotonic time in ktime_t format
- *
- * returns the time in ktime_t format
- */
-ktime_t ktime_get(void)
-{
-       struct timespec now;
-
-       ktime_get_ts(&now);
-
-       return timespec_to_ktime(now);
-}
-EXPORT_SYMBOL_GPL(ktime_get);
-
-/**
- * ktime_get_ts - get the monotonic clock in timespec format
- * @ts:                pointer to timespec variable
- *
- * The function calculates the monotonic clock from the realtime
- * clock and the wall_to_monotonic offset and stores the result
- * in normalized timespec format in the variable pointed to by @ts.
- */
-void ktime_get_ts(struct timespec *ts)
-{
-       struct timespec tomono;
-       unsigned long seq;
-
-       do {
-               seq = read_seqbegin(&xtime_lock);
-               getnstimeofday(ts);
-               tomono = wall_to_monotonic;
-
-       } while (read_seqretry(&xtime_lock, seq));
-
-       set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec,
-                               ts->tv_nsec + tomono.tv_nsec);
-}
-EXPORT_SYMBOL_GPL(ktime_get_ts);
-
-#endif /* !GENERIC_TIME */
-
 /**
  * ktime_get_real - get the real (wall-) time in ktime_t format
  *
@@ -579,9 +533,9 @@ static int timekeeping_resume(struct sys_device *dev)
 
        if (timespec_compare(&ts, &timekeeping_suspend_time) > 0) {
                ts = timespec_sub(ts, timekeeping_suspend_time);
-               xtime = timespec_add_safe(xtime, ts);
+               xtime = timespec_add(xtime, ts);
                wall_to_monotonic = timespec_sub(wall_to_monotonic, ts);
-               total_sleep_time = timespec_add_safe(total_sleep_time, ts);
+               total_sleep_time = timespec_add(total_sleep_time, ts);
        }
        /* re-base the last cycle value */
        timekeeper.clock->cycle_last = timekeeper.clock->read(timekeeper.clock);
@@ -784,10 +738,11 @@ void update_wall_time(void)
                return;
 
        clock = timekeeper.clock;
-#ifdef CONFIG_GENERIC_TIME
-       offset = (clock->read(clock) - clock->cycle_last) & clock->mask;
-#else
+
+#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
        offset = timekeeper.cycle_interval;
+#else
+       offset = (clock->read(clock) - clock->cycle_last) & clock->mask;
 #endif
        timekeeper.xtime_nsec = (s64)xtime.tv_nsec << timekeeper.shift;
 
@@ -856,7 +811,8 @@ void update_wall_time(void)
        }
 
        /* check to see if there is a new clocksource to use */
-       update_vsyscall(&xtime, timekeeper.clock, timekeeper.mult);
+       update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock,
+                               timekeeper.mult);
 }
 
 /**
@@ -887,7 +843,7 @@ EXPORT_SYMBOL_GPL(getboottime);
  */
 void monotonic_to_bootbased(struct timespec *ts)
 {
-       *ts = timespec_add_safe(*ts, total_sleep_time);
+       *ts = timespec_add(*ts, total_sleep_time);
 }
 EXPORT_SYMBOL_GPL(monotonic_to_bootbased);
 
@@ -902,6 +858,11 @@ struct timespec __current_kernel_time(void)
        return xtime;
 }
 
+struct timespec __get_wall_to_monotonic(void)
+{
+       return wall_to_monotonic;
+}
+
 struct timespec current_kernel_time(void)
 {
        struct timespec now;
index c7683fd8a03ac09cc61a4125a904379a305f233b..6eb97bbdefb17dd3f611e160a80e76780f35eac5 100644 (file)
@@ -153,7 +153,7 @@ config IRQSOFF_TRACER
        bool "Interrupts-off Latency Tracer"
        default n
        depends on TRACE_IRQFLAGS_SUPPORT
-       depends on GENERIC_TIME
+       depends on !ARCH_USES_GETTIMEOFFSET
        select TRACE_IRQFLAGS
        select GENERIC_TRACER
        select TRACER_MAX_TRACE
@@ -175,7 +175,7 @@ config IRQSOFF_TRACER
 config PREEMPT_TRACER
        bool "Preemption-off Latency Tracer"
        default n
-       depends on GENERIC_TIME
+       depends on !ARCH_USES_GETTIMEOFFSET
        depends on PREEMPT
        select GENERIC_TRACER
        select TRACER_MAX_TRACE