Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43224b96 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer updates from Thomas Gleixner:
 "A rather largish update for everything time and timer related:

   - Cache footprint optimizations for both hrtimers and timer wheel

   - Lower the NOHZ impact on systems which have NOHZ or timer migration
     disabled at runtime.

   - Optimize run time overhead of hrtimer interrupt by making the clock
     offset updates smarter

   - hrtimer cleanups and removal of restrictions to tackle some
     problems in sched/perf

   - Some more leap second tweaks

   - Another round of changes addressing the 2038 problem

   - First step to change the internals of clock event devices by
     introducing the necessary infrastructure

   - Allow constant folding for usecs/msecs_to_jiffies()

   - The usual pile of clockevent/clocksource driver updates

  The hrtimer changes contain updates to sched, perf and x86 as they
  depend on them plus changes all over the tree to cleanup API changes
  and redundant code, which got copied all over the place.  The y2038
  changes touch s390 to remove the last non 2038 safe code related to
  boot/persistant clock"

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (114 commits)
  clocksource: Increase dependencies of timer-stm32 to limit build wreckage
  timer: Minimize nohz off overhead
  timer: Reduce timer migration overhead if disabled
  timer: Stats: Simplify the flags handling
  timer: Replace timer base by a cpu index
  timer: Use hlist for the timer wheel hash buckets
  timer: Remove FIFO "guarantee"
  timers: Sanitize catchup_timer_jiffies() usage
  hrtimer: Allow hrtimer::function() to free the timer
  seqcount: Introduce raw_write_seqcount_barrier()
  seqcount: Rename write_seqcount_barrier()
  hrtimer: Fix hrtimer_is_queued() hole
  hrtimer: Remove HRTIMER_STATE_MIGRATE
  selftest: Timers: Avoid signal deadlock in leap-a-day
  timekeeping: Copy the shadow-timekeeper over the real timekeeper last
  clockevents: Check state instead of mode in suspend/resume path
  selftests: timers: Add leap-second timer edge testing to leap-a-day.c
  ntp: Do leapsecond adjustment in adjtimex read path
  time: Prevent early expiry of hrtimers[CLOCK_REALTIME] at the leap second edge
  ntp: Introduce and use SECS_PER_DAY macro instead of 86400
  ...
parents d70b3ef5 1cb6c215
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
* ARMv7M System Timer

ARMv7-M includes a system timer, known as SysTick. Current driver only
implements the clocksource feature.

Required properties:
- compatible	  : Should be "arm,armv7m-systick"
- reg		  : The address range of the timer

Required clocking property, have to be one of:
- clocks	  : The input clock of the timer
- clock-frequency : The rate in HZ in input of the ARM SysTick

Examples:

systick: timer@e000e010 {
	compatible = "arm,armv7m-systick";
	reg = <0xe000e010 0x10>;
	clocks = <&clk_systick>;
};

systick: timer@e000e010 {
	compatible = "arm,armv7m-systick";
	reg = <0xe000e010 0x10>;
	clock-frequency = <90000000>;
};
+26 −0
Original line number Diff line number Diff line
* NXP LPC3220 timer

The NXP LPC3220 timer is used on a wide range of NXP SoCs. This
includes LPC32xx, LPC178x, LPC18xx and LPC43xx parts.

Required properties:
- compatible:
	Should be "nxp,lpc3220-timer".
- reg:
	Address and length of the register set.
- interrupts:
	Reference to the timer interrupt
- clocks:
	Should contain a reference to timer clock.
- clock-names:
	Should contain "timerclk".

Example:

timer1: timer@40085000 {
	compatible = "nxp,lpc3220-timer";
	reg = <0x40085000 0x1000>;
	interrupts = <13>;
	clocks = <&ccu1 CLK_CPU_TIMER1>;
	clock-names = "timerclk";
};
+22 −0
Original line number Diff line number Diff line
. STMicroelectronics STM32 timer

The STM32 MCUs family has several general-purpose 16 and 32 bits timers.

Required properties:
- compatible : Should be "st,stm32-timer"
- reg : Address and length of the register set
- clocks : Reference on the timer input clock
- interrupts : Reference to the timer interrupt

Optional properties:
- resets: Reference to a reset controller asserting the timer

Example:

timer5: timer@40000c00 {
	compatible = "st,stm32-timer";
	reg = <0x40000c00 0x400>;
	interrupts = <50>;
	resets = <&rrc 259>;
	clocks = <&clk_pmtr1>;
};
+27 −7
Original line number Diff line number Diff line
@@ -2,8 +2,9 @@
# Kbuild for top-level directory of the kernel
# This file takes care of the following:
# 1) Generate bounds.h
# 2) Generate asm-offsets.h (may need bounds.h)
# 3) Check for missing system calls
# 2) Generate timeconst.h
# 3) Generate asm-offsets.h (may need bounds.h and timeconst.h)
# 4) Check for missing system calls

# Default sed regexp - multiline due to syntax constraints
define sed-y
@@ -47,7 +48,26 @@ $(obj)/$(bounds-file): kernel/bounds.s FORCE
	$(call filechk,offsets,__LINUX_BOUNDS_H__)

#####
# 2) Generate asm-offsets.h
# 2) Generate timeconst.h

timeconst-file := include/generated/timeconst.h

#always  += $(timeconst-file)
targets += $(timeconst-file)

quiet_cmd_gentimeconst = GEN     $@
define cmd_gentimeconst
	(echo $(CONFIG_HZ) | bc -q $< ) > $@
endef
define filechk_gentimeconst
	(echo $(CONFIG_HZ) | bc -q $< )
endef

$(obj)/$(timeconst-file): kernel/time/timeconst.bc FORCE
	$(call filechk,gentimeconst)

#####
# 3) Generate asm-offsets.h
#

offsets-file := include/generated/asm-offsets.h
@@ -57,7 +77,7 @@ targets += arch/$(SRCARCH)/kernel/asm-offsets.s

# We use internal kbuild rules to avoid the "is up to date" message from make
arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \
                                      $(obj)/$(bounds-file) FORCE
                                      $(obj)/$(timeconst-file) $(obj)/$(bounds-file) FORCE
	$(Q)mkdir -p $(dir $@)
	$(call if_changed_dep,cc_s_c)

@@ -65,7 +85,7 @@ $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
	$(call filechk,offsets,__ASM_OFFSETS_H__)

#####
# 3) Check for missing system calls
# 4) Check for missing system calls
#

always += missing-syscalls
@@ -77,5 +97,5 @@ quiet_cmd_syscalls = CALL $<
missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
	$(call cmd,syscalls)

# Keep these two files during make clean
no-clean-files := $(bounds-file) $(offsets-file)
# Keep these three files during make clean
no-clean-files := $(bounds-file) $(offsets-file) $(timeconst-file)
+3 −2
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#define _ASM_S390_TIMEX_H

#include <asm/lowcore.h>
#include <linux/time64.h>

/* The value of the TOD clock for 1.1.1970. */
#define TOD_UNIX_EPOCH 0x7d91048bca000000ULL
@@ -108,10 +109,10 @@ int get_sync_clock(unsigned long long *clock);
void init_cpu_timer(void);
unsigned long long monotonic_clock(void);

void tod_to_timeval(__u64, struct timespec *);
void tod_to_timeval(__u64 todval, struct timespec64 *xt);

static inline
void stck_to_timespec(unsigned long long stck, struct timespec *ts)
void stck_to_timespec64(unsigned long long stck, struct timespec64 *ts)
{
	tod_to_timeval(stck - TOD_UNIX_EPOCH, ts);
}
Loading