Skip to content

Commit

Permalink
timekeeping: remove arch_gettimeoffset
Browse files Browse the repository at this point in the history
With Arm EBSA110 gone, nothing uses it any more, so the corresponding
code and the Kconfig option can be removed.

Acked-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
arndb committed Oct 30, 2020
1 parent 0d9dc74 commit 77f6c0b
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 92 deletions.
33 changes: 0 additions & 33 deletions Documentation/features/time/modern-timekeeping/arch-support.txt

This file was deleted.

2 changes: 0 additions & 2 deletions drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ obj-$(CONFIG_INFINIBAND) += infiniband/
obj-y += firmware/
obj-$(CONFIG_CRYPTO) += crypto/
obj-$(CONFIG_SUPERH) += sh/
ifndef CONFIG_ARCH_USES_GETTIMEOFFSET
obj-y += clocksource/
endif
obj-$(CONFIG_DCA) += dca/
obj-$(CONFIG_HID) += hid/
obj-$(CONFIG_PPC_PS3) += ps3/
Expand Down
2 changes: 1 addition & 1 deletion drivers/clocksource/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ config CLKSRC_QCOM

config CLKSRC_VERSATILE
bool "ARM Versatile (Express) reference platforms clock source" if COMPILE_TEST
depends on GENERIC_SCHED_CLOCK && !ARCH_USES_GETTIMEOFFSET
depends on GENERIC_SCHED_CLOCK
select TIMER_OF
default y if (ARCH_VEXPRESS || ARCH_VERSATILE) && ARM
help
Expand Down
13 changes: 0 additions & 13 deletions include/linux/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@ extern time64_t mktime64(const unsigned int year, const unsigned int mon,
const unsigned int day, const unsigned int hour,
const unsigned int min, const unsigned int sec);

/* Some architectures do not supply their own clocksource.
* This is mainly the case in architectures that get their
* inter-tick times by reading the counter on their interval
* timer. Since these timers wrap every tick, they're not really
* useful as clocksources. Wrapping them to act like one is possible
* but not very efficient. So we provide a callout these arches
* can implement for use with the jiffies clocksource to provide
* finer then tick granular time.
*/
#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
extern u32 (*arch_gettimeoffset)(void);
#endif

#ifdef CONFIG_POSIX_TIMERS
extern void clear_itimer(void);
#else
Expand Down
9 changes: 0 additions & 9 deletions kernel/time/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ config CLOCKSOURCE_VALIDATE_LAST_CYCLE
config GENERIC_TIME_VSYSCALL
bool

# Old style timekeeping
config ARCH_USES_GETTIMEOFFSET
bool

# The generic clock events infrastructure
config GENERIC_CLOCKEVENTS
bool
Expand Down Expand Up @@ -72,7 +68,6 @@ config TICK_ONESHOT

config NO_HZ_COMMON
bool
depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
select TICK_ONESHOT

choice
Expand All @@ -87,7 +82,6 @@ config HZ_PERIODIC

config NO_HZ_IDLE
bool "Idle dynticks system (tickless idle)"
depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
select NO_HZ_COMMON
help
This option enables a tickless idle system: timer interrupts
Expand All @@ -99,7 +93,6 @@ config NO_HZ_IDLE
config NO_HZ_FULL
bool "Full dynticks system (tickless)"
# NO_HZ_COMMON dependency
depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
# We need at least one periodic CPU for timekeeping
depends on SMP
depends on HAVE_CONTEXT_TRACKING
Expand Down Expand Up @@ -158,15 +151,13 @@ config CONTEXT_TRACKING_FORCE

config NO_HZ
bool "Old Idle dynticks config"
depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
help
This is the old config entry that enables dynticks idle.
We keep it around for a little while to enforce backward
compatibility with older config files.

config HIGH_RES_TIMERS
bool "High Resolution Timer Support"
depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
select TICK_ONESHOT
help
This option enables high resolution timer support. If your
Expand Down
8 changes: 0 additions & 8 deletions kernel/time/clocksource.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,6 @@ static inline void clocksource_update_max_deferment(struct clocksource *cs)
&cs->max_cycles);
}

#ifndef CONFIG_ARCH_USES_GETTIMEOFFSET

static struct clocksource *clocksource_find_best(bool oneshot, bool skipcur)
{
struct clocksource *cs;
Expand Down Expand Up @@ -798,12 +796,6 @@ static void clocksource_select_fallback(void)
__clocksource_select(true);
}

#else /* !CONFIG_ARCH_USES_GETTIMEOFFSET */
static inline void clocksource_select(void) { }
static inline void clocksource_select_fallback(void) { }

#endif

/*
* clocksource_done_booting - Called near the end of core bootup
*
Expand Down
25 changes: 1 addition & 24 deletions kernel/time/timekeeping.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,22 +369,14 @@ static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock)

/* Timekeeper helper functions. */

#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
static u32 default_arch_gettimeoffset(void) { return 0; }
u32 (*arch_gettimeoffset)(void) = default_arch_gettimeoffset;
#else
static inline u32 arch_gettimeoffset(void) { return 0; }
#endif

static inline u64 timekeeping_delta_to_ns(const struct tk_read_base *tkr, u64 delta)
{
u64 nsec;

nsec = delta * tkr->mult + tkr->xtime_nsec;
nsec >>= tkr->shift;

/* If arch requires, add in get_arch_timeoffset() */
return nsec + arch_gettimeoffset();
return nsec;
}

static inline u64 timekeeping_get_ns(const struct tk_read_base *tkr)
Expand Down Expand Up @@ -778,16 +770,8 @@ static void timekeeping_forward_now(struct timekeeper *tk)
tk->tkr_raw.cycle_last = cycle_now;

tk->tkr_mono.xtime_nsec += delta * tk->tkr_mono.mult;

/* If arch requires, add in get_arch_timeoffset() */
tk->tkr_mono.xtime_nsec += (u64)arch_gettimeoffset() << tk->tkr_mono.shift;


tk->tkr_raw.xtime_nsec += delta * tk->tkr_raw.mult;

/* If arch requires, add in get_arch_timeoffset() */
tk->tkr_raw.xtime_nsec += (u64)arch_gettimeoffset() << tk->tkr_raw.shift;

tk_normalize_xtime(tk);
}

Expand Down Expand Up @@ -2133,19 +2117,12 @@ static void timekeeping_advance(enum timekeeping_adv_mode mode)
if (unlikely(timekeeping_suspended))
goto out;

#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
offset = real_tk->cycle_interval;

if (mode != TK_ADV_TICK)
goto out;
#else
offset = clocksource_delta(tk_clock_read(&tk->tkr_mono),
tk->tkr_mono.cycle_last, tk->tkr_mono.mask);

/* Check if there's really nothing to do */
if (offset < real_tk->cycle_interval && mode == TK_ADV_TICK)
goto out;
#endif

/* Do some additional sanity checking */
timekeeping_check_update(tk, offset);
Expand Down
2 changes: 0 additions & 2 deletions kernel/trace/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ config IRQSOFF_TRACER
bool "Interrupts-off Latency Tracer"
default n
depends on TRACE_IRQFLAGS_SUPPORT
depends on !ARCH_USES_GETTIMEOFFSET
select TRACE_IRQFLAGS
select GENERIC_TRACER
select TRACER_MAX_TRACE
Expand All @@ -277,7 +276,6 @@ config IRQSOFF_TRACER
config PREEMPT_TRACER
bool "Preemption-off Latency Tracer"
default n
depends on !ARCH_USES_GETTIMEOFFSET
depends on PREEMPTION
select GENERIC_TRACER
select TRACER_MAX_TRACE
Expand Down

0 comments on commit 77f6c0b

Please sign in to comment.