diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-29 16:55:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-29 16:55:30 -0400 |
commit | a6408f6cb63ac0958fee7dbce7861ffb540d8a49 (patch) | |
tree | c94a835d343974171951e3b805e6bbbb02852ebc /drivers/clocksource/timer-atlas7.c | |
parent | 1a81a8f2a5918956e214bb718099a89e500e7ec5 (diff) | |
parent | 4fae16dffb812f0e0d98a0b2b0856ca48ca63e6c (diff) |
Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull smp hotplug updates from Thomas Gleixner:
"This is the next part of the hotplug rework.
- Convert all notifiers with a priority assigned
- Convert all CPU_STARTING/DYING notifiers
The final removal of the STARTING/DYING infrastructure will happen
when the merge window closes.
Another 700 hundred line of unpenetrable maze gone :)"
* 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits)
timers/core: Correct callback order during CPU hot plug
leds/trigger/cpu: Move from CPU_STARTING to ONLINE level
powerpc/numa: Convert to hotplug state machine
arm/perf: Fix hotplug state machine conversion
irqchip/armada: Avoid unused function warnings
ARC/time: Convert to hotplug state machine
clocksource/atlas7: Convert to hotplug state machine
clocksource/armada-370-xp: Convert to hotplug state machine
clocksource/exynos_mct: Convert to hotplug state machine
clocksource/arm_global_timer: Convert to hotplug state machine
rcu: Convert rcutree to hotplug state machine
KVM/arm/arm64/vgic-new: Convert to hotplug state machine
smp/cfd: Convert core to hotplug state machine
x86/x2apic: Convert to CPU hotplug state machine
profile: Convert to hotplug state machine
timers/core: Convert to hotplug state machine
hrtimer: Convert to hotplug state machine
x86/tboot: Convert to hotplug state machine
arm64/armv8 deprecated: Convert to hotplug state machine
hwtracing/coresight-etm4x: Convert to hotplug state machine
...
Diffstat (limited to 'drivers/clocksource/timer-atlas7.c')
-rw-r--r-- | drivers/clocksource/timer-atlas7.c | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/drivers/clocksource/timer-atlas7.c b/drivers/clocksource/timer-atlas7.c index 90f8fbc154a4..4334e0330ada 100644 --- a/drivers/clocksource/timer-atlas7.c +++ b/drivers/clocksource/timer-atlas7.c | |||
@@ -172,9 +172,9 @@ static struct irqaction sirfsoc_timer1_irq = { | |||
172 | .handler = sirfsoc_timer_interrupt, | 172 | .handler = sirfsoc_timer_interrupt, |
173 | }; | 173 | }; |
174 | 174 | ||
175 | static int sirfsoc_local_timer_setup(struct clock_event_device *ce) | 175 | static int sirfsoc_local_timer_starting_cpu(unsigned int cpu) |
176 | { | 176 | { |
177 | int cpu = smp_processor_id(); | 177 | struct clock_event_device *ce = per_cpu_ptr(sirfsoc_clockevent, cpu); |
178 | struct irqaction *action; | 178 | struct irqaction *action; |
179 | 179 | ||
180 | if (cpu == 0) | 180 | if (cpu == 0) |
@@ -203,50 +203,27 @@ static int sirfsoc_local_timer_setup(struct clock_event_device *ce) | |||
203 | return 0; | 203 | return 0; |
204 | } | 204 | } |
205 | 205 | ||
206 | static void sirfsoc_local_timer_stop(struct clock_event_device *ce) | 206 | static int sirfsoc_local_timer_dying_cpu(unsigned int cpu) |
207 | { | 207 | { |
208 | int cpu = smp_processor_id(); | ||
209 | |||
210 | sirfsoc_timer_count_disable(1); | 208 | sirfsoc_timer_count_disable(1); |
211 | 209 | ||
212 | if (cpu == 0) | 210 | if (cpu == 0) |
213 | remove_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq); | 211 | remove_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq); |
214 | else | 212 | else |
215 | remove_irq(sirfsoc_timer1_irq.irq, &sirfsoc_timer1_irq); | 213 | remove_irq(sirfsoc_timer1_irq.irq, &sirfsoc_timer1_irq); |
214 | return 0; | ||
216 | } | 215 | } |
217 | 216 | ||
218 | static int sirfsoc_cpu_notify(struct notifier_block *self, | ||
219 | unsigned long action, void *hcpu) | ||
220 | { | ||
221 | /* | ||
222 | * Grab cpu pointer in each case to avoid spurious | ||
223 | * preemptible warnings | ||
224 | */ | ||
225 | switch (action & ~CPU_TASKS_FROZEN) { | ||
226 | case CPU_STARTING: | ||
227 | sirfsoc_local_timer_setup(this_cpu_ptr(sirfsoc_clockevent)); | ||
228 | break; | ||
229 | case CPU_DYING: | ||
230 | sirfsoc_local_timer_stop(this_cpu_ptr(sirfsoc_clockevent)); | ||
231 | break; | ||
232 | } | ||
233 | |||
234 | return NOTIFY_OK; | ||
235 | } | ||
236 | |||
237 | static struct notifier_block sirfsoc_cpu_nb = { | ||
238 | .notifier_call = sirfsoc_cpu_notify, | ||
239 | }; | ||
240 | |||
241 | static int __init sirfsoc_clockevent_init(void) | 217 | static int __init sirfsoc_clockevent_init(void) |
242 | { | 218 | { |
243 | sirfsoc_clockevent = alloc_percpu(struct clock_event_device); | 219 | sirfsoc_clockevent = alloc_percpu(struct clock_event_device); |
244 | BUG_ON(!sirfsoc_clockevent); | 220 | BUG_ON(!sirfsoc_clockevent); |
245 | 221 | ||
246 | BUG_ON(register_cpu_notifier(&sirfsoc_cpu_nb)); | 222 | /* Install and invoke hotplug callbacks */ |
247 | 223 | return cpuhp_setup_state(CPUHP_AP_MARCO_TIMER_STARTING, | |
248 | /* Immediately configure the timer on the boot CPU */ | 224 | "AP_MARCO_TIMER_STARTING", |
249 | return sirfsoc_local_timer_setup(this_cpu_ptr(sirfsoc_clockevent)); | 225 | sirfsoc_local_timer_starting_cpu, |
226 | sirfsoc_local_timer_dying_cpu); | ||
250 | } | 227 | } |
251 | 228 | ||
252 | /* initialize the kernel jiffy timer source */ | 229 | /* initialize the kernel jiffy timer source */ |