aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-03-05 15:14:43 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-05 15:14:43 -0500
commit18483190e7a2a6761b67c6824a31adf5b2b7be51 (patch)
tree9754b4c8eb72626827b48ae4f23c58df48d17499 /kernel
parentd9862cfbe2099deb83f0e9c1932c91f2d9c50464 (diff)
parent8dd2eee2f444a7a570599bffc9da330157cca5b5 (diff)
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer and clockevent updates from Thomas Gleixner: "The time(r) core and clockevent updates are mostly boring this time: - A new driver for the Tegra210 timer - Small fixes and improvements alll over the place - Documentation updates and cleanups" * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (22 commits) soc/tegra: default select TEGRA_TIMER for Tegra210 clocksource/drivers/tegra: Add Tegra210 timer support dt-bindings: timer: add Tegra210 timer clocksource/drivers/timer-cs5535: Rename the file for consistency clocksource/drivers/timer-pxa: Rename the file for consistency clocksource/drivers/tango-xtal: Rename the file for consistency dt-bindings: timer: gpt: update binding doc clocksource/drivers/exynos_mct: Remove unused header includes dt-bindings: timer: mediatek: update bindings for MT7629 SoC clocksource/drivers/exynos_mct: Fix error path in timer resources initialization clocksource/drivers/exynos_mct: Remove dead code clocksource/drivers/riscv: Add required checks during clock source init dt-bindings: timer: renesas: tmu: Document r8a774c0 bindings dt-bindings: timer: renesas, cmt: Document r8a774c0 CMT support clocksource/drivers/exynos_mct: Clear timer interrupt when shutdown clocksource/drivers/exynos_mct: Move one-shot check from tick clear to ISR clocksource/drivers/arch_timer: Workaround for Allwinner A64 timer instability clocksource/drivers/sun5i: Fail gracefully when clock rate is unavailable timers: Mark expected switch fall-throughs timekeeping/debug: No need to check return value of debugfs_create functions ...
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rcu/Kconfig30
-rw-r--r--kernel/time/Kconfig29
-rw-r--r--kernel/time/hrtimer.c2
-rw-r--r--kernel/time/posix-cpu-timers.c13
-rw-r--r--kernel/time/tick-broadcast.c1
-rw-r--r--kernel/time/timekeeping_debug.c11
-rw-r--r--kernel/time/timer.c2
7 files changed, 40 insertions, 48 deletions
diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig
index 939a2056c87a..37301430970e 100644
--- a/kernel/rcu/Kconfig
+++ b/kernel/rcu/Kconfig
@@ -87,36 +87,6 @@ config RCU_STALL_COMMON
87config RCU_NEED_SEGCBLIST 87config RCU_NEED_SEGCBLIST
88 def_bool ( TREE_RCU || PREEMPT_RCU || TREE_SRCU ) 88 def_bool ( TREE_RCU || PREEMPT_RCU || TREE_SRCU )
89 89
90config CONTEXT_TRACKING
91 bool
92
93config CONTEXT_TRACKING_FORCE
94 bool "Force context tracking"
95 depends on CONTEXT_TRACKING
96 default y if !NO_HZ_FULL
97 help
98 The major pre-requirement for full dynticks to work is to
99 support the context tracking subsystem. But there are also
100 other dependencies to provide in order to make the full
101 dynticks working.
102
103 This option stands for testing when an arch implements the
104 context tracking backend but doesn't yet fullfill all the
105 requirements to make the full dynticks feature working.
106 Without the full dynticks, there is no way to test the support
107 for context tracking and the subsystems that rely on it: RCU
108 userspace extended quiescent state and tickless cputime
109 accounting. This option copes with the absence of the full
110 dynticks subsystem by forcing the context tracking on all
111 CPUs in the system.
112
113 Say Y only if you're working on the development of an
114 architecture backend for the context tracking.
115
116 Say N otherwise, this option brings an overhead that you
117 don't want in production.
118
119
120config RCU_FANOUT 90config RCU_FANOUT
121 int "Tree-based hierarchical RCU fanout value" 91 int "Tree-based hierarchical RCU fanout value"
122 range 2 64 if 64BIT 92 range 2 64 if 64BIT
diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
index 58b981f4bb5d..e2c038d6c13c 100644
--- a/kernel/time/Kconfig
+++ b/kernel/time/Kconfig
@@ -117,6 +117,35 @@ config NO_HZ_FULL
117 117
118endchoice 118endchoice
119 119
120config CONTEXT_TRACKING
121 bool
122
123config CONTEXT_TRACKING_FORCE
124 bool "Force context tracking"
125 depends on CONTEXT_TRACKING
126 default y if !NO_HZ_FULL
127 help
128 The major pre-requirement for full dynticks to work is to
129 support the context tracking subsystem. But there are also
130 other dependencies to provide in order to make the full
131 dynticks working.
132
133 This option stands for testing when an arch implements the
134 context tracking backend but doesn't yet fullfill all the
135 requirements to make the full dynticks feature working.
136 Without the full dynticks, there is no way to test the support
137 for context tracking and the subsystems that rely on it: RCU
138 userspace extended quiescent state and tickless cputime
139 accounting. This option copes with the absence of the full
140 dynticks subsystem by forcing the context tracking on all
141 CPUs in the system.
142
143 Say Y only if you're working on the development of an
144 architecture backend for the context tracking.
145
146 Say N otherwise, this option brings an overhead that you
147 don't want in production.
148
120config NO_HZ 149config NO_HZ
121 bool "Old Idle dynticks config" 150 bool "Old Idle dynticks config"
122 depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS 151 depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index f5cfa1b73d6f..6418e1bdc549 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -364,7 +364,7 @@ static bool hrtimer_fixup_activate(void *addr, enum debug_obj_state state)
364 switch (state) { 364 switch (state) {
365 case ODEBUG_STATE_ACTIVE: 365 case ODEBUG_STATE_ACTIVE:
366 WARN_ON(1); 366 WARN_ON(1);
367 367 /* fall through */
368 default: 368 default:
369 return false; 369 return false;
370 } 370 }
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index 80f955210861..0a426f4e3125 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -67,13 +67,13 @@ static void bump_cpu_timer(struct k_itimer *timer, u64 now)
67 int i; 67 int i;
68 u64 delta, incr; 68 u64 delta, incr;
69 69
70 if (timer->it.cpu.incr == 0) 70 if (!timer->it_interval)
71 return; 71 return;
72 72
73 if (now < timer->it.cpu.expires) 73 if (now < timer->it.cpu.expires)
74 return; 74 return;
75 75
76 incr = timer->it.cpu.incr; 76 incr = timer->it_interval;
77 delta = now + incr - timer->it.cpu.expires; 77 delta = now + incr - timer->it.cpu.expires;
78 78
79 /* Don't use (incr*2 < delta), incr*2 might overflow. */ 79 /* Don't use (incr*2 < delta), incr*2 might overflow. */
@@ -520,7 +520,7 @@ static void cpu_timer_fire(struct k_itimer *timer)
520 */ 520 */
521 wake_up_process(timer->it_process); 521 wake_up_process(timer->it_process);
522 timer->it.cpu.expires = 0; 522 timer->it.cpu.expires = 0;
523 } else if (timer->it.cpu.incr == 0) { 523 } else if (!timer->it_interval) {
524 /* 524 /*
525 * One-shot timer. Clear it as soon as it's fired. 525 * One-shot timer. Clear it as soon as it's fired.
526 */ 526 */
@@ -606,7 +606,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags,
606 */ 606 */
607 607
608 ret = 0; 608 ret = 0;
609 old_incr = timer->it.cpu.incr; 609 old_incr = timer->it_interval;
610 old_expires = timer->it.cpu.expires; 610 old_expires = timer->it.cpu.expires;
611 if (unlikely(timer->it.cpu.firing)) { 611 if (unlikely(timer->it.cpu.firing)) {
612 timer->it.cpu.firing = -1; 612 timer->it.cpu.firing = -1;
@@ -684,8 +684,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags,
684 * Install the new reload setting, and 684 * Install the new reload setting, and
685 * set up the signal and overrun bookkeeping. 685 * set up the signal and overrun bookkeeping.
686 */ 686 */
687 timer->it.cpu.incr = timespec64_to_ns(&new->it_interval); 687 timer->it_interval = timespec64_to_ktime(new->it_interval);
688 timer->it_interval = ns_to_ktime(timer->it.cpu.incr);
689 688
690 /* 689 /*
691 * This acts as a modification timestamp for the timer, 690 * This acts as a modification timestamp for the timer,
@@ -724,7 +723,7 @@ static void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec64 *itp
724 /* 723 /*
725 * Easy part: convert the reload time. 724 * Easy part: convert the reload time.
726 */ 725 */
727 itp->it_interval = ns_to_timespec64(timer->it.cpu.incr); 726 itp->it_interval = ktime_to_timespec64(timer->it_interval);
728 727
729 if (!timer->it.cpu.expires) 728 if (!timer->it.cpu.expires)
730 return; 729 return;
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 803fa67aace9..ee834d4fb814 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -375,6 +375,7 @@ void tick_broadcast_control(enum tick_broadcast_mode mode)
375 switch (mode) { 375 switch (mode) {
376 case TICK_BROADCAST_FORCE: 376 case TICK_BROADCAST_FORCE:
377 tick_broadcast_forced = 1; 377 tick_broadcast_forced = 1;
378 /* fall through */
378 case TICK_BROADCAST_ON: 379 case TICK_BROADCAST_ON:
379 cpumask_set_cpu(cpu, tick_broadcast_on); 380 cpumask_set_cpu(cpu, tick_broadcast_on);
380 if (!cpumask_test_and_set_cpu(cpu, tick_broadcast_mask)) { 381 if (!cpumask_test_and_set_cpu(cpu, tick_broadcast_mask)) {
diff --git a/kernel/time/timekeeping_debug.c b/kernel/time/timekeeping_debug.c
index 86489950d690..b73e8850e58d 100644
--- a/kernel/time/timekeeping_debug.c
+++ b/kernel/time/timekeeping_debug.c
@@ -37,15 +37,8 @@ DEFINE_SHOW_ATTRIBUTE(tk_debug_sleep_time);
37 37
38static int __init tk_debug_sleep_time_init(void) 38static int __init tk_debug_sleep_time_init(void)
39{ 39{
40 struct dentry *d; 40 debugfs_create_file("sleep_time", 0444, NULL, NULL,
41 41 &tk_debug_sleep_time_fops);
42 d = debugfs_create_file("sleep_time", 0444, NULL, NULL,
43 &tk_debug_sleep_time_fops);
44 if (!d) {
45 pr_err("Failed to create sleep_time debug file\n");
46 return -ENOMEM;
47 }
48
49 return 0; 42 return 0;
50} 43}
51late_initcall(tk_debug_sleep_time_init); 44late_initcall(tk_debug_sleep_time_init);
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 444156debfa0..167e71f9ed3c 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -647,7 +647,7 @@ static bool timer_fixup_activate(void *addr, enum debug_obj_state state)
647 647
648 case ODEBUG_STATE_ACTIVE: 648 case ODEBUG_STATE_ACTIVE:
649 WARN_ON(1); 649 WARN_ON(1);
650 650 /* fall through */
651 default: 651 default:
652 return false; 652 return false;
653 } 653 }