smp.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. /*
  2. * This program is free software; you can redistribute it and/or
  3. * modify it under the terms of the GNU General Public License
  4. * as published by the Free Software Foundation; either version 2
  5. * of the License, or (at your option) any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program; if not, write to the Free Software
  14. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  15. *
  16. * Copyright (C) 2000, 2001 Kanoj Sarcar
  17. * Copyright (C) 2000, 2001 Ralf Baechle
  18. * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
  19. * Copyright (C) 2000, 2001, 2003 Broadcom Corporation
  20. */
  21. #include <linux/cache.h>
  22. #include <linux/delay.h>
  23. #include <linux/init.h>
  24. #include <linux/interrupt.h>
  25. #include <linux/smp.h>
  26. #include <linux/spinlock.h>
  27. #include <linux/threads.h>
  28. #include <linux/export.h>
  29. #include <linux/time.h>
  30. #include <linux/timex.h>
  31. #include <linux/sched/mm.h>
  32. #include <linux/cpumask.h>
  33. #include <linux/cpu.h>
  34. #include <linux/err.h>
  35. #include <linux/ftrace.h>
  36. #include <linux/irqdomain.h>
  37. #include <linux/of.h>
  38. #include <linux/of_irq.h>
  39. #include <linux/atomic.h>
  40. #include <asm/cpu.h>
  41. #include <asm/processor.h>
  42. #include <asm/idle.h>
  43. #include <asm/r4k-timer.h>
  44. #include <asm/mips-cps.h>
  45. #include <asm/mmu_context.h>
  46. #include <asm/time.h>
  47. #include <asm/setup.h>
  48. #include <asm/maar.h>
  49. int __cpu_number_map[CONFIG_MIPS_NR_CPU_NR_MAP]; /* Map physical to logical */
  50. EXPORT_SYMBOL(__cpu_number_map);
  51. int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */
  52. EXPORT_SYMBOL(__cpu_logical_map);
  53. /* Number of TCs (or siblings in Intel speak) per CPU core */
  54. int smp_num_siblings = 1;
  55. EXPORT_SYMBOL(smp_num_siblings);
  56. /* representing the TCs (or siblings in Intel speak) of each logical CPU */
  57. cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly;
  58. EXPORT_SYMBOL(cpu_sibling_map);
  59. /* representing the core map of multi-core chips of each logical CPU */
  60. cpumask_t cpu_core_map[NR_CPUS] __read_mostly;
  61. EXPORT_SYMBOL(cpu_core_map);
  62. static DECLARE_COMPLETION(cpu_starting);
  63. static DECLARE_COMPLETION(cpu_running);
  64. /*
  65. * A logcal cpu mask containing only one VPE per core to
  66. * reduce the number of IPIs on large MT systems.
  67. */
  68. cpumask_t cpu_foreign_map[NR_CPUS] __read_mostly;
  69. EXPORT_SYMBOL(cpu_foreign_map);
  70. /* representing cpus for which sibling maps can be computed */
  71. static cpumask_t cpu_sibling_setup_map;
  72. /* representing cpus for which core maps can be computed */
  73. static cpumask_t cpu_core_setup_map;
  74. cpumask_t cpu_coherent_mask;
  75. #ifdef CONFIG_GENERIC_IRQ_IPI
  76. static struct irq_desc *call_desc;
  77. static struct irq_desc *sched_desc;
  78. #endif
  79. static inline void set_cpu_sibling_map(int cpu)
  80. {
  81. int i;
  82. cpumask_set_cpu(cpu, &cpu_sibling_setup_map);
  83. if (smp_num_siblings > 1) {
  84. for_each_cpu(i, &cpu_sibling_setup_map) {
  85. if (cpus_are_siblings(cpu, i)) {
  86. cpumask_set_cpu(i, &cpu_sibling_map[cpu]);
  87. cpumask_set_cpu(cpu, &cpu_sibling_map[i]);
  88. }
  89. }
  90. } else
  91. cpumask_set_cpu(cpu, &cpu_sibling_map[cpu]);
  92. }
  93. static inline void set_cpu_core_map(int cpu)
  94. {
  95. int i;
  96. cpumask_set_cpu(cpu, &cpu_core_setup_map);
  97. for_each_cpu(i, &cpu_core_setup_map) {
  98. if (cpu_data[cpu].package == cpu_data[i].package) {
  99. cpumask_set_cpu(i, &cpu_core_map[cpu]);
  100. cpumask_set_cpu(cpu, &cpu_core_map[i]);
  101. }
  102. }
  103. }
  104. /*
  105. * Calculate a new cpu_foreign_map mask whenever a
  106. * new cpu appears or disappears.
  107. */
  108. void calculate_cpu_foreign_map(void)
  109. {
  110. int i, k, core_present;
  111. cpumask_t temp_foreign_map;
  112. /* Re-calculate the mask */
  113. cpumask_clear(&temp_foreign_map);
  114. for_each_online_cpu(i) {
  115. core_present = 0;
  116. for_each_cpu(k, &temp_foreign_map)
  117. if (cpus_are_siblings(i, k))
  118. core_present = 1;
  119. if (!core_present)
  120. cpumask_set_cpu(i, &temp_foreign_map);
  121. }
  122. for_each_online_cpu(i)
  123. cpumask_andnot(&cpu_foreign_map[i],
  124. &temp_foreign_map, &cpu_sibling_map[i]);
  125. }
  126. const struct plat_smp_ops *mp_ops;
  127. EXPORT_SYMBOL(mp_ops);
  128. void register_smp_ops(const struct plat_smp_ops *ops)
  129. {
  130. if (mp_ops)
  131. printk(KERN_WARNING "Overriding previously set SMP ops\n");
  132. mp_ops = ops;
  133. }
  134. #ifdef CONFIG_GENERIC_IRQ_IPI
  135. void mips_smp_send_ipi_single(int cpu, unsigned int action)
  136. {
  137. mips_smp_send_ipi_mask(cpumask_of(cpu), action);
  138. }
  139. void mips_smp_send_ipi_mask(const struct cpumask *mask, unsigned int action)
  140. {
  141. unsigned long flags;
  142. unsigned int core;
  143. int cpu;
  144. local_irq_save(flags);
  145. switch (action) {
  146. case SMP_CALL_FUNCTION:
  147. __ipi_send_mask(call_desc, mask);
  148. break;
  149. case SMP_RESCHEDULE_YOURSELF:
  150. __ipi_send_mask(sched_desc, mask);
  151. break;
  152. default:
  153. BUG();
  154. }
  155. if (mips_cpc_present()) {
  156. for_each_cpu(cpu, mask) {
  157. if (cpus_are_siblings(cpu, smp_processor_id()))
  158. continue;
  159. core = cpu_core(&cpu_data[cpu]);
  160. while (!cpumask_test_cpu(cpu, &cpu_coherent_mask)) {
  161. mips_cm_lock_other_cpu(cpu, CM_GCR_Cx_OTHER_BLOCK_LOCAL);
  162. mips_cpc_lock_other(core);
  163. write_cpc_co_cmd(CPC_Cx_CMD_PWRUP);
  164. mips_cpc_unlock_other();
  165. mips_cm_unlock_other();
  166. }
  167. }
  168. }
  169. local_irq_restore(flags);
  170. }
  171. static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id)
  172. {
  173. scheduler_ipi();
  174. return IRQ_HANDLED;
  175. }
  176. static irqreturn_t ipi_call_interrupt(int irq, void *dev_id)
  177. {
  178. generic_smp_call_function_interrupt();
  179. return IRQ_HANDLED;
  180. }
  181. static struct irqaction irq_resched = {
  182. .handler = ipi_resched_interrupt,
  183. .flags = IRQF_PERCPU,
  184. .name = "IPI resched"
  185. };
  186. static struct irqaction irq_call = {
  187. .handler = ipi_call_interrupt,
  188. .flags = IRQF_PERCPU,
  189. .name = "IPI call"
  190. };
  191. static void smp_ipi_init_one(unsigned int virq,
  192. struct irqaction *action)
  193. {
  194. int ret;
  195. irq_set_handler(virq, handle_percpu_irq);
  196. ret = setup_irq(virq, action);
  197. BUG_ON(ret);
  198. }
  199. static unsigned int call_virq, sched_virq;
  200. int mips_smp_ipi_allocate(const struct cpumask *mask)
  201. {
  202. int virq;
  203. struct irq_domain *ipidomain;
  204. struct device_node *node;
  205. node = of_irq_find_parent(of_root);
  206. ipidomain = irq_find_matching_host(node, DOMAIN_BUS_IPI);
  207. /*
  208. * Some platforms have half DT setup. So if we found irq node but
  209. * didn't find an ipidomain, try to search for one that is not in the
  210. * DT.
  211. */
  212. if (node && !ipidomain)
  213. ipidomain = irq_find_matching_host(NULL, DOMAIN_BUS_IPI);
  214. /*
  215. * There are systems which use IPI IRQ domains, but only have one
  216. * registered when some runtime condition is met. For example a Malta
  217. * kernel may include support for GIC & CPU interrupt controller IPI
  218. * IRQ domains, but if run on a system with no GIC & no MT ASE then
  219. * neither will be supported or registered.
  220. *
  221. * We only have a problem if we're actually using multiple CPUs so fail
  222. * loudly if that is the case. Otherwise simply return, skipping IPI
  223. * setup, if we're running with only a single CPU.
  224. */
  225. if (!ipidomain) {
  226. BUG_ON(num_present_cpus() > 1);
  227. return 0;
  228. }
  229. virq = irq_reserve_ipi(ipidomain, mask);
  230. BUG_ON(!virq);
  231. if (!call_virq)
  232. call_virq = virq;
  233. virq = irq_reserve_ipi(ipidomain, mask);
  234. BUG_ON(!virq);
  235. if (!sched_virq)
  236. sched_virq = virq;
  237. if (irq_domain_is_ipi_per_cpu(ipidomain)) {
  238. int cpu;
  239. for_each_cpu(cpu, mask) {
  240. smp_ipi_init_one(call_virq + cpu, &irq_call);
  241. smp_ipi_init_one(sched_virq + cpu, &irq_resched);
  242. }
  243. } else {
  244. smp_ipi_init_one(call_virq, &irq_call);
  245. smp_ipi_init_one(sched_virq, &irq_resched);
  246. }
  247. return 0;
  248. }
  249. int mips_smp_ipi_free(const struct cpumask *mask)
  250. {
  251. struct irq_domain *ipidomain;
  252. struct device_node *node;
  253. node = of_irq_find_parent(of_root);
  254. ipidomain = irq_find_matching_host(node, DOMAIN_BUS_IPI);
  255. /*
  256. * Some platforms have half DT setup. So if we found irq node but
  257. * didn't find an ipidomain, try to search for one that is not in the
  258. * DT.
  259. */
  260. if (node && !ipidomain)
  261. ipidomain = irq_find_matching_host(NULL, DOMAIN_BUS_IPI);
  262. BUG_ON(!ipidomain);
  263. if (irq_domain_is_ipi_per_cpu(ipidomain)) {
  264. int cpu;
  265. for_each_cpu(cpu, mask) {
  266. remove_irq(call_virq + cpu, &irq_call);
  267. remove_irq(sched_virq + cpu, &irq_resched);
  268. }
  269. }
  270. irq_destroy_ipi(call_virq, mask);
  271. irq_destroy_ipi(sched_virq, mask);
  272. return 0;
  273. }
  274. static int __init mips_smp_ipi_init(void)
  275. {
  276. if (num_possible_cpus() == 1)
  277. return 0;
  278. mips_smp_ipi_allocate(cpu_possible_mask);
  279. call_desc = irq_to_desc(call_virq);
  280. sched_desc = irq_to_desc(sched_virq);
  281. return 0;
  282. }
  283. early_initcall(mips_smp_ipi_init);
  284. #endif
  285. /*
  286. * First C code run on the secondary CPUs after being started up by
  287. * the master.
  288. */
  289. asmlinkage void start_secondary(void)
  290. {
  291. unsigned int cpu;
  292. cpu_probe();
  293. per_cpu_trap_init(false);
  294. mips_clockevent_init();
  295. mp_ops->init_secondary();
  296. cpu_report();
  297. maar_init();
  298. /*
  299. * XXX parity protection should be folded in here when it's converted
  300. * to an option instead of something based on .cputype
  301. */
  302. calibrate_delay();
  303. preempt_disable();
  304. cpu = smp_processor_id();
  305. cpu_data[cpu].udelay_val = loops_per_jiffy;
  306. cpumask_set_cpu(cpu, &cpu_coherent_mask);
  307. notify_cpu_starting(cpu);
  308. /* Notify boot CPU that we're starting & ready to sync counters */
  309. complete(&cpu_starting);
  310. synchronise_count_slave(cpu);
  311. /* The CPU is running and counters synchronised, now mark it online */
  312. set_cpu_online(cpu, true);
  313. set_cpu_sibling_map(cpu);
  314. set_cpu_core_map(cpu);
  315. calculate_cpu_foreign_map();
  316. /*
  317. * Notify boot CPU that we're up & online and it can safely return
  318. * from __cpu_up
  319. */
  320. complete(&cpu_running);
  321. /*
  322. * irq will be enabled in ->smp_finish(), enabling it too early
  323. * is dangerous.
  324. */
  325. WARN_ON_ONCE(!irqs_disabled());
  326. mp_ops->smp_finish();
  327. cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
  328. }
  329. static void stop_this_cpu(void *dummy)
  330. {
  331. /*
  332. * Remove this CPU:
  333. */
  334. set_cpu_online(smp_processor_id(), false);
  335. calculate_cpu_foreign_map();
  336. local_irq_disable();
  337. while (1);
  338. }
  339. void smp_send_stop(void)
  340. {
  341. smp_call_function(stop_this_cpu, NULL, 0);
  342. }
  343. void __init smp_cpus_done(unsigned int max_cpus)
  344. {
  345. }
  346. /* called from main before smp_init() */
  347. void __init smp_prepare_cpus(unsigned int max_cpus)
  348. {
  349. init_new_context(current, &init_mm);
  350. current_thread_info()->cpu = 0;
  351. mp_ops->prepare_cpus(max_cpus);
  352. set_cpu_sibling_map(0);
  353. set_cpu_core_map(0);
  354. calculate_cpu_foreign_map();
  355. #ifndef CONFIG_HOTPLUG_CPU
  356. init_cpu_present(cpu_possible_mask);
  357. #endif
  358. cpumask_copy(&cpu_coherent_mask, cpu_possible_mask);
  359. }
  360. /* preload SMP state for boot cpu */
  361. void smp_prepare_boot_cpu(void)
  362. {
  363. set_cpu_possible(0, true);
  364. set_cpu_online(0, true);
  365. }
  366. int __cpu_up(unsigned int cpu, struct task_struct *tidle)
  367. {
  368. int err;
  369. err = mp_ops->boot_secondary(cpu, tidle);
  370. if (err)
  371. return err;
  372. /* Wait for CPU to start and be ready to sync counters */
  373. if (!wait_for_completion_timeout(&cpu_starting,
  374. msecs_to_jiffies(1000))) {
  375. pr_crit("CPU%u: failed to start\n", cpu);
  376. return -EIO;
  377. }
  378. synchronise_count_master(cpu);
  379. /* Wait for CPU to finish startup & mark itself online before return */
  380. wait_for_completion(&cpu_running);
  381. return 0;
  382. }
  383. /* Not really SMP stuff ... */
  384. int setup_profiling_timer(unsigned int multiplier)
  385. {
  386. return 0;
  387. }
  388. static void flush_tlb_all_ipi(void *info)
  389. {
  390. local_flush_tlb_all();
  391. }
  392. void flush_tlb_all(void)
  393. {
  394. on_each_cpu(flush_tlb_all_ipi, NULL, 1);
  395. }
  396. static void flush_tlb_mm_ipi(void *mm)
  397. {
  398. local_flush_tlb_mm((struct mm_struct *)mm);
  399. }
  400. /*
  401. * Special Variant of smp_call_function for use by TLB functions:
  402. *
  403. * o No return value
  404. * o collapses to normal function call on UP kernels
  405. * o collapses to normal function call on systems with a single shared
  406. * primary cache.
  407. */
  408. static inline void smp_on_other_tlbs(void (*func) (void *info), void *info)
  409. {
  410. smp_call_function(func, info, 1);
  411. }
  412. static inline void smp_on_each_tlb(void (*func) (void *info), void *info)
  413. {
  414. preempt_disable();
  415. smp_on_other_tlbs(func, info);
  416. func(info);
  417. preempt_enable();
  418. }
  419. /*
  420. * The following tlb flush calls are invoked when old translations are
  421. * being torn down, or pte attributes are changing. For single threaded
  422. * address spaces, a new context is obtained on the current cpu, and tlb
  423. * context on other cpus are invalidated to force a new context allocation
  424. * at switch_mm time, should the mm ever be used on other cpus. For
  425. * multithreaded address spaces, intercpu interrupts have to be sent.
  426. * Another case where intercpu interrupts are required is when the target
  427. * mm might be active on another cpu (eg debuggers doing the flushes on
  428. * behalf of debugees, kswapd stealing pages from another process etc).
  429. * Kanoj 07/00.
  430. */
  431. void flush_tlb_mm(struct mm_struct *mm)
  432. {
  433. preempt_disable();
  434. if ((atomic_read(&mm->mm_users) != 1) || (current->mm != mm)) {
  435. smp_on_other_tlbs(flush_tlb_mm_ipi, mm);
  436. } else {
  437. unsigned int cpu;
  438. for_each_online_cpu(cpu) {
  439. if (cpu != smp_processor_id() && cpu_context(cpu, mm))
  440. cpu_context(cpu, mm) = 0;
  441. }
  442. }
  443. local_flush_tlb_mm(mm);
  444. preempt_enable();
  445. }
  446. struct flush_tlb_data {
  447. struct vm_area_struct *vma;
  448. unsigned long addr1;
  449. unsigned long addr2;
  450. };
  451. static void flush_tlb_range_ipi(void *info)
  452. {
  453. struct flush_tlb_data *fd = info;
  454. local_flush_tlb_range(fd->vma, fd->addr1, fd->addr2);
  455. }
  456. void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
  457. {
  458. struct mm_struct *mm = vma->vm_mm;
  459. preempt_disable();
  460. if ((atomic_read(&mm->mm_users) != 1) || (current->mm != mm)) {
  461. struct flush_tlb_data fd = {
  462. .vma = vma,
  463. .addr1 = start,
  464. .addr2 = end,
  465. };
  466. smp_on_other_tlbs(flush_tlb_range_ipi, &fd);
  467. } else {
  468. unsigned int cpu;
  469. int exec = vma->vm_flags & VM_EXEC;
  470. for_each_online_cpu(cpu) {
  471. /*
  472. * flush_cache_range() will only fully flush icache if
  473. * the VMA is executable, otherwise we must invalidate
  474. * ASID without it appearing to has_valid_asid() as if
  475. * mm has been completely unused by that CPU.
  476. */
  477. if (cpu != smp_processor_id() && cpu_context(cpu, mm))
  478. cpu_context(cpu, mm) = !exec;
  479. }
  480. }
  481. local_flush_tlb_range(vma, start, end);
  482. preempt_enable();
  483. }
  484. static void flush_tlb_kernel_range_ipi(void *info)
  485. {
  486. struct flush_tlb_data *fd = info;
  487. local_flush_tlb_kernel_range(fd->addr1, fd->addr2);
  488. }
  489. void flush_tlb_kernel_range(unsigned long start, unsigned long end)
  490. {
  491. struct flush_tlb_data fd = {
  492. .addr1 = start,
  493. .addr2 = end,
  494. };
  495. on_each_cpu(flush_tlb_kernel_range_ipi, &fd, 1);
  496. }
  497. static void flush_tlb_page_ipi(void *info)
  498. {
  499. struct flush_tlb_data *fd = info;
  500. local_flush_tlb_page(fd->vma, fd->addr1);
  501. }
  502. void flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
  503. {
  504. preempt_disable();
  505. if ((atomic_read(&vma->vm_mm->mm_users) != 1) || (current->mm != vma->vm_mm)) {
  506. struct flush_tlb_data fd = {
  507. .vma = vma,
  508. .addr1 = page,
  509. };
  510. smp_on_other_tlbs(flush_tlb_page_ipi, &fd);
  511. } else {
  512. unsigned int cpu;
  513. for_each_online_cpu(cpu) {
  514. /*
  515. * flush_cache_page() only does partial flushes, so
  516. * invalidate ASID without it appearing to
  517. * has_valid_asid() as if mm has been completely unused
  518. * by that CPU.
  519. */
  520. if (cpu != smp_processor_id() && cpu_context(cpu, vma->vm_mm))
  521. cpu_context(cpu, vma->vm_mm) = 1;
  522. }
  523. }
  524. local_flush_tlb_page(vma, page);
  525. preempt_enable();
  526. }
  527. static void flush_tlb_one_ipi(void *info)
  528. {
  529. unsigned long vaddr = (unsigned long) info;
  530. local_flush_tlb_one(vaddr);
  531. }
  532. void flush_tlb_one(unsigned long vaddr)
  533. {
  534. smp_on_each_tlb(flush_tlb_one_ipi, (void *) vaddr);
  535. }
  536. EXPORT_SYMBOL(flush_tlb_page);
  537. EXPORT_SYMBOL(flush_tlb_one);
  538. #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
  539. static DEFINE_PER_CPU(atomic_t, tick_broadcast_count);
  540. static DEFINE_PER_CPU(call_single_data_t, tick_broadcast_csd);
  541. void tick_broadcast(const struct cpumask *mask)
  542. {
  543. atomic_t *count;
  544. call_single_data_t *csd;
  545. int cpu;
  546. for_each_cpu(cpu, mask) {
  547. count = &per_cpu(tick_broadcast_count, cpu);
  548. csd = &per_cpu(tick_broadcast_csd, cpu);
  549. if (atomic_inc_return(count) == 1)
  550. smp_call_function_single_async(cpu, csd);
  551. }
  552. }
  553. static void tick_broadcast_callee(void *info)
  554. {
  555. int cpu = smp_processor_id();
  556. tick_receive_broadcast();
  557. atomic_set(&per_cpu(tick_broadcast_count, cpu), 0);
  558. }
  559. static int __init tick_broadcast_init(void)
  560. {
  561. call_single_data_t *csd;
  562. int cpu;
  563. for (cpu = 0; cpu < NR_CPUS; cpu++) {
  564. csd = &per_cpu(tick_broadcast_csd, cpu);
  565. csd->func = tick_broadcast_callee;
  566. }
  567. return 0;
  568. }
  569. early_initcall(tick_broadcast_init);
  570. #endif /* CONFIG_GENERIC_CLOCKEVENTS_BROADCAST */