aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/tick-sched.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-03 21:09:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-03 21:09:13 -0400
commit5e1b834b27fb2c27cde33a0752425f11d10c0b2d (patch)
tree055c2c7165dcf0ccd73a273b16ad493ff48823a6 /kernel/time/tick-sched.c
parent49deffe0b0e4c2030696c7a6fd680bacf4761069 (diff)
parentb536fd587044af02183b3c02690431b93154f0fa (diff)
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 smalish set of updates for timers and timekeeping: - Two core fixes to prevent potential undefinded behaviour about which gcc is complaining rightfully. - A fix to prevent stopping the tick on an (soon) offline CPU so it can complete the shutdown procedure. - Wait for clocks to stabilize before making decisions, so a not yet validated clock is not rejected. - The usual pile of fixes to the various clocksource drivers. - Core code typo and include fixlets" * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: timekeeping: Include the correct header for errno definitions clocksource/drivers/ti-32k: Prevent ftrace recursion clocksource/mips-gic-timer: Stop checking cpu_has_counter clocksource/mips-gic-timer: Print an error if IRQ setup fails tick/nohz: Prevent stopping the tick on an offline CPU clocksource/drivers/oxnas: Add OX820 compatible clocksource/drivers/timer-atmel-pit: Simplify IRQ handler clocksource/drivers/timer-atmel-pit: Remove uselesss WARN_ON_ONCE clocksource/drivers/timer-atmel-pit: Drop at91sam926x_pit_common_init clocksource/drivers/moxart: Replace panic by pr_err clocksource/drivers/moxart: Replace setup_irq by request_irq clocksource/drivers/moxart: Add Aspeed support clocksource/drivers/moxart: Use struct to hold state clocksource/drivers/moxart: Refactor enable/disable time: Avoid undefined behaviour in ktime_add_safe() time: Avoid undefined behaviour in timespec64_add_safe() timekeeping: Prints the amounts of time spent during suspend clocksource: Defer override invalidation unless clock is unstable hrtimer: Spelling fixes
Diffstat (limited to 'kernel/time/tick-sched.c')
-rw-r--r--kernel/time/tick-sched.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 2ec7c00228f3..3bcb61b52f6c 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -186,10 +186,13 @@ static bool check_tick_dependency(atomic_t *dep)
186 return false; 186 return false;
187} 187}
188 188
189static bool can_stop_full_tick(struct tick_sched *ts) 189static bool can_stop_full_tick(int cpu, struct tick_sched *ts)
190{ 190{
191 WARN_ON_ONCE(!irqs_disabled()); 191 WARN_ON_ONCE(!irqs_disabled());
192 192
193 if (unlikely(!cpu_online(cpu)))
194 return false;
195
193 if (check_tick_dependency(&tick_dep_mask)) 196 if (check_tick_dependency(&tick_dep_mask))
194 return false; 197 return false;
195 198
@@ -843,7 +846,7 @@ static void tick_nohz_full_update_tick(struct tick_sched *ts)
843 if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE) 846 if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE)
844 return; 847 return;
845 848
846 if (can_stop_full_tick(ts)) 849 if (can_stop_full_tick(cpu, ts))
847 tick_nohz_stop_sched_tick(ts, ktime_get(), cpu); 850 tick_nohz_stop_sched_tick(ts, ktime_get(), cpu);
848 else if (ts->tick_stopped) 851 else if (ts->tick_stopped)
849 tick_nohz_restart_sched_tick(ts, ktime_get()); 852 tick_nohz_restart_sched_tick(ts, ktime_get());