From 24bfcb100959c8641a627b5604d967243f8f240c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 26 Jun 2015 22:08:38 +0200 Subject: timer: Fix hotplug regression The recent timer wheel rework removed the get/put_cpu_var() pair in the hotplug migration code, which results in: BUG: using smp_processor_id() in preemptible [00000000] code: hib.sh/2845 ... [] timer_cpu_notify+0x53/0x12 That hunk is a leftover from an earlier iteration and went unnoticed so far. Restore the previous code which was obviously correct. Fixes: 0eeda71bc30d 'timer: Replace timer base by a cpu index' Reported-and_tested-by: Borislav Petkov Signed-off-by: Thomas Gleixner --- kernel/time/timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 520499dd85af..5e097fa9faf7 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1566,7 +1566,7 @@ static void migrate_timers(int cpu) BUG_ON(cpu_online(cpu)); old_base = per_cpu_ptr(&tvec_bases, cpu); - new_base = this_cpu_ptr(&tvec_bases); + new_base = get_cpu_ptr(&tvec_bases); /* * The caller is globally serialized and nobody else * takes two locks at once, deadlock is not possible. @@ -1590,6 +1590,7 @@ static void migrate_timers(int cpu) spin_unlock(&old_base->lock); spin_unlock_irq(&new_base->lock); + put_cpu_ptr(&tvec_bases); } static int timer_cpu_notify(struct notifier_block *self, -- cgit v1.2.3-59-g8ed1b From 65f26062cd8f653dac11d3c00d326f7f57b5e098 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 1 Jul 2015 09:57:35 +0200 Subject: time: Remove development rules from Kbuild/Makefile time.o gets rebuilt unconditionally due to a leftover Makefile rule which was placed there for development purposes. Remove it along with the commented out always rule in the toplevel Kbuild file. Fixes: 0a227985d4a9 'time: Move timeconst.h into include/generated' Reported-by; Stephen Boyd Signed-off-by: Thomas Gleixner Cc: Nicholas Mc Guire --- Kbuild | 1 - kernel/time/Makefile | 2 -- 2 files changed, 3 deletions(-) (limited to 'kernel') diff --git a/Kbuild b/Kbuild index df99a5f53beb..f55cefd9bf29 100644 --- a/Kbuild +++ b/Kbuild @@ -52,7 +52,6 @@ $(obj)/$(bounds-file): kernel/bounds.s FORCE timeconst-file := include/generated/timeconst.h -#always += $(timeconst-file) targets += $(timeconst-file) quiet_cmd_gentimeconst = GEN $@ diff --git a/kernel/time/Makefile b/kernel/time/Makefile index ffc4cc3dcd47..49eca0beed32 100644 --- a/kernel/time/Makefile +++ b/kernel/time/Makefile @@ -12,5 +12,3 @@ obj-$(CONFIG_TICK_ONESHOT) += tick-oneshot.o tick-sched.o obj-$(CONFIG_TIMER_STATS) += timer_stats.o obj-$(CONFIG_DEBUG_FS) += timekeeping_debug.o obj-$(CONFIG_TEST_UDELAY) += test_udelay.o - -$(obj)/time.o: $(objtree)/include/config/ -- cgit v1.2.3-59-g8ed1b