octeon-irq.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2004-2008 Cavium Networks
  7. */
  8. #include <linux/irq.h>
  9. #include <linux/interrupt.h>
  10. #include <linux/smp.h>
  11. #include <asm/octeon/octeon.h>
  12. #include <asm/octeon/cvmx-pexp-defs.h>
  13. #include <asm/octeon/cvmx-npi-defs.h>
  14. DEFINE_RWLOCK(octeon_irq_ciu0_rwlock);
  15. DEFINE_RWLOCK(octeon_irq_ciu1_rwlock);
  16. DEFINE_SPINLOCK(octeon_irq_msi_lock);
  17. static void octeon_irq_core_ack(unsigned int irq)
  18. {
  19. unsigned int bit = irq - OCTEON_IRQ_SW0;
  20. /*
  21. * We don't need to disable IRQs to make these atomic since
  22. * they are already disabled earlier in the low level
  23. * interrupt code.
  24. */
  25. clear_c0_status(0x100 << bit);
  26. /* The two user interrupts must be cleared manually. */
  27. if (bit < 2)
  28. clear_c0_cause(0x100 << bit);
  29. }
  30. static void octeon_irq_core_eoi(unsigned int irq)
  31. {
  32. struct irq_desc *desc = irq_desc + irq;
  33. unsigned int bit = irq - OCTEON_IRQ_SW0;
  34. /*
  35. * If an IRQ is being processed while we are disabling it the
  36. * handler will attempt to unmask the interrupt after it has
  37. * been disabled.
  38. */
  39. if (desc->status & IRQ_DISABLED)
  40. return;
  41. /* There is a race here. We should fix it. */
  42. /*
  43. * We don't need to disable IRQs to make these atomic since
  44. * they are already disabled earlier in the low level
  45. * interrupt code.
  46. */
  47. set_c0_status(0x100 << bit);
  48. }
  49. static void octeon_irq_core_enable(unsigned int irq)
  50. {
  51. unsigned long flags;
  52. unsigned int bit = irq - OCTEON_IRQ_SW0;
  53. /*
  54. * We need to disable interrupts to make sure our updates are
  55. * atomic.
  56. */
  57. local_irq_save(flags);
  58. set_c0_status(0x100 << bit);
  59. local_irq_restore(flags);
  60. }
  61. static void octeon_irq_core_disable_local(unsigned int irq)
  62. {
  63. unsigned long flags;
  64. unsigned int bit = irq - OCTEON_IRQ_SW0;
  65. /*
  66. * We need to disable interrupts to make sure our updates are
  67. * atomic.
  68. */
  69. local_irq_save(flags);
  70. clear_c0_status(0x100 << bit);
  71. local_irq_restore(flags);
  72. }
  73. static void octeon_irq_core_disable(unsigned int irq)
  74. {
  75. #ifdef CONFIG_SMP
  76. on_each_cpu((void (*)(void *)) octeon_irq_core_disable_local,
  77. (void *) (long) irq, 1);
  78. #else
  79. octeon_irq_core_disable_local(irq);
  80. #endif
  81. }
  82. static struct irq_chip octeon_irq_chip_core = {
  83. .name = "Core",
  84. .enable = octeon_irq_core_enable,
  85. .disable = octeon_irq_core_disable,
  86. .ack = octeon_irq_core_ack,
  87. .eoi = octeon_irq_core_eoi,
  88. };
  89. static void octeon_irq_ciu0_ack(unsigned int irq)
  90. {
  91. /*
  92. * In order to avoid any locking accessing the CIU, we
  93. * acknowledge CIU interrupts by disabling all of them. This
  94. * way we can use a per core register and avoid any out of
  95. * core locking requirements. This has the side affect that
  96. * CIU interrupts can't be processed recursively.
  97. *
  98. * We don't need to disable IRQs to make these atomic since
  99. * they are already disabled earlier in the low level
  100. * interrupt code.
  101. */
  102. clear_c0_status(0x100 << 2);
  103. }
  104. static void octeon_irq_ciu0_eoi(unsigned int irq)
  105. {
  106. /*
  107. * Enable all CIU interrupts again. We don't need to disable
  108. * IRQs to make these atomic since they are already disabled
  109. * earlier in the low level interrupt code.
  110. */
  111. set_c0_status(0x100 << 2);
  112. }
  113. static void octeon_irq_ciu0_enable(unsigned int irq)
  114. {
  115. int coreid = cvmx_get_core_num();
  116. unsigned long flags;
  117. uint64_t en0;
  118. int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */
  119. /*
  120. * A read lock is used here to make sure only one core is ever
  121. * updating the CIU enable bits at a time. During an enable
  122. * the cores don't interfere with each other. During a disable
  123. * the write lock stops any enables that might cause a
  124. * problem.
  125. */
  126. read_lock_irqsave(&octeon_irq_ciu0_rwlock, flags);
  127. en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
  128. en0 |= 1ull << bit;
  129. cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0);
  130. cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
  131. read_unlock_irqrestore(&octeon_irq_ciu0_rwlock, flags);
  132. }
  133. static void octeon_irq_ciu0_disable(unsigned int irq)
  134. {
  135. int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */
  136. unsigned long flags;
  137. uint64_t en0;
  138. #ifdef CONFIG_SMP
  139. int cpu;
  140. write_lock_irqsave(&octeon_irq_ciu0_rwlock, flags);
  141. for_each_online_cpu(cpu) {
  142. int coreid = cpu_logical_map(cpu);
  143. en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
  144. en0 &= ~(1ull << bit);
  145. cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0);
  146. }
  147. /*
  148. * We need to do a read after the last update to make sure all
  149. * of them are done.
  150. */
  151. cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2));
  152. write_unlock_irqrestore(&octeon_irq_ciu0_rwlock, flags);
  153. #else
  154. int coreid = cvmx_get_core_num();
  155. local_irq_save(flags);
  156. en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
  157. en0 &= ~(1ull << bit);
  158. cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0);
  159. cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
  160. local_irq_restore(flags);
  161. #endif
  162. }
  163. #ifdef CONFIG_SMP
  164. static int octeon_irq_ciu0_set_affinity(unsigned int irq, const struct cpumask *dest)
  165. {
  166. int cpu;
  167. int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */
  168. write_lock(&octeon_irq_ciu0_rwlock);
  169. for_each_online_cpu(cpu) {
  170. int coreid = cpu_logical_map(cpu);
  171. uint64_t en0 =
  172. cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
  173. if (cpumask_test_cpu(cpu, dest))
  174. en0 |= 1ull << bit;
  175. else
  176. en0 &= ~(1ull << bit);
  177. cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0);
  178. }
  179. /*
  180. * We need to do a read after the last update to make sure all
  181. * of them are done.
  182. */
  183. cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2));
  184. write_unlock(&octeon_irq_ciu0_rwlock);
  185. return 0;
  186. }
  187. #endif
  188. static struct irq_chip octeon_irq_chip_ciu0 = {
  189. .name = "CIU0",
  190. .enable = octeon_irq_ciu0_enable,
  191. .disable = octeon_irq_ciu0_disable,
  192. .ack = octeon_irq_ciu0_ack,
  193. .eoi = octeon_irq_ciu0_eoi,
  194. #ifdef CONFIG_SMP
  195. .set_affinity = octeon_irq_ciu0_set_affinity,
  196. #endif
  197. };
  198. static void octeon_irq_ciu1_ack(unsigned int irq)
  199. {
  200. /*
  201. * In order to avoid any locking accessing the CIU, we
  202. * acknowledge CIU interrupts by disabling all of them. This
  203. * way we can use a per core register and avoid any out of
  204. * core locking requirements. This has the side affect that
  205. * CIU interrupts can't be processed recursively. We don't
  206. * need to disable IRQs to make these atomic since they are
  207. * already disabled earlier in the low level interrupt code.
  208. */
  209. clear_c0_status(0x100 << 3);
  210. }
  211. static void octeon_irq_ciu1_eoi(unsigned int irq)
  212. {
  213. /*
  214. * Enable all CIU interrupts again. We don't need to disable
  215. * IRQs to make these atomic since they are already disabled
  216. * earlier in the low level interrupt code.
  217. */
  218. set_c0_status(0x100 << 3);
  219. }
  220. static void octeon_irq_ciu1_enable(unsigned int irq)
  221. {
  222. int coreid = cvmx_get_core_num();
  223. unsigned long flags;
  224. uint64_t en1;
  225. int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */
  226. /*
  227. * A read lock is used here to make sure only one core is ever
  228. * updating the CIU enable bits at a time. During an enable
  229. * the cores don't interfere with each other. During a disable
  230. * the write lock stops any enables that might cause a
  231. * problem.
  232. */
  233. read_lock_irqsave(&octeon_irq_ciu1_rwlock, flags);
  234. en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
  235. en1 |= 1ull << bit;
  236. cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1);
  237. cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
  238. read_unlock_irqrestore(&octeon_irq_ciu1_rwlock, flags);
  239. }
  240. static void octeon_irq_ciu1_disable(unsigned int irq)
  241. {
  242. int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */
  243. unsigned long flags;
  244. uint64_t en1;
  245. #ifdef CONFIG_SMP
  246. int cpu;
  247. write_lock_irqsave(&octeon_irq_ciu1_rwlock, flags);
  248. for_each_online_cpu(cpu) {
  249. int coreid = cpu_logical_map(cpu);
  250. en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
  251. en1 &= ~(1ull << bit);
  252. cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1);
  253. }
  254. /*
  255. * We need to do a read after the last update to make sure all
  256. * of them are done.
  257. */
  258. cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1));
  259. write_unlock_irqrestore(&octeon_irq_ciu1_rwlock, flags);
  260. #else
  261. int coreid = cvmx_get_core_num();
  262. local_irq_save(flags);
  263. en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
  264. en1 &= ~(1ull << bit);
  265. cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1);
  266. cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
  267. local_irq_restore(flags);
  268. #endif
  269. }
  270. #ifdef CONFIG_SMP
  271. static int octeon_irq_ciu1_set_affinity(unsigned int irq, const struct cpumask *dest)
  272. {
  273. int cpu;
  274. int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */
  275. write_lock(&octeon_irq_ciu1_rwlock);
  276. for_each_online_cpu(cpu) {
  277. int coreid = cpu_logical_map(cpu);
  278. uint64_t en1 =
  279. cvmx_read_csr(CVMX_CIU_INTX_EN1
  280. (coreid * 2 + 1));
  281. if (cpumask_test_cpu(cpu, dest))
  282. en1 |= 1ull << bit;
  283. else
  284. en1 &= ~(1ull << bit);
  285. cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1);
  286. }
  287. /*
  288. * We need to do a read after the last update to make sure all
  289. * of them are done.
  290. */
  291. cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1));
  292. write_unlock(&octeon_irq_ciu1_rwlock);
  293. return 0;
  294. }
  295. #endif
  296. static struct irq_chip octeon_irq_chip_ciu1 = {
  297. .name = "CIU1",
  298. .enable = octeon_irq_ciu1_enable,
  299. .disable = octeon_irq_ciu1_disable,
  300. .ack = octeon_irq_ciu1_ack,
  301. .eoi = octeon_irq_ciu1_eoi,
  302. #ifdef CONFIG_SMP
  303. .set_affinity = octeon_irq_ciu1_set_affinity,
  304. #endif
  305. };
  306. #ifdef CONFIG_PCI_MSI
  307. static void octeon_irq_msi_ack(unsigned int irq)
  308. {
  309. if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) {
  310. /* These chips have PCI */
  311. cvmx_write_csr(CVMX_NPI_NPI_MSI_RCV,
  312. 1ull << (irq - OCTEON_IRQ_MSI_BIT0));
  313. } else {
  314. /*
  315. * These chips have PCIe. Thankfully the ACK doesn't
  316. * need any locking.
  317. */
  318. cvmx_write_csr(CVMX_PEXP_NPEI_MSI_RCV0,
  319. 1ull << (irq - OCTEON_IRQ_MSI_BIT0));
  320. }
  321. }
  322. static void octeon_irq_msi_eoi(unsigned int irq)
  323. {
  324. /* Nothing needed */
  325. }
  326. static void octeon_irq_msi_enable(unsigned int irq)
  327. {
  328. if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) {
  329. /*
  330. * Octeon PCI doesn't have the ability to mask/unmask
  331. * MSI interrupts individually. Instead of
  332. * masking/unmasking them in groups of 16, we simple
  333. * assume MSI devices are well behaved. MSI
  334. * interrupts are always enable and the ACK is assumed
  335. * to be enough.
  336. */
  337. } else {
  338. /* These chips have PCIe. Note that we only support
  339. * the first 64 MSI interrupts. Unfortunately all the
  340. * MSI enables are in the same register. We use
  341. * MSI0's lock to control access to them all.
  342. */
  343. uint64_t en;
  344. unsigned long flags;
  345. spin_lock_irqsave(&octeon_irq_msi_lock, flags);
  346. en = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
  347. en |= 1ull << (irq - OCTEON_IRQ_MSI_BIT0);
  348. cvmx_write_csr(CVMX_PEXP_NPEI_MSI_ENB0, en);
  349. cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
  350. spin_unlock_irqrestore(&octeon_irq_msi_lock, flags);
  351. }
  352. }
  353. static void octeon_irq_msi_disable(unsigned int irq)
  354. {
  355. if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) {
  356. /* See comment in enable */
  357. } else {
  358. /*
  359. * These chips have PCIe. Note that we only support
  360. * the first 64 MSI interrupts. Unfortunately all the
  361. * MSI enables are in the same register. We use
  362. * MSI0's lock to control access to them all.
  363. */
  364. uint64_t en;
  365. unsigned long flags;
  366. spin_lock_irqsave(&octeon_irq_msi_lock, flags);
  367. en = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
  368. en &= ~(1ull << (irq - OCTEON_IRQ_MSI_BIT0));
  369. cvmx_write_csr(CVMX_PEXP_NPEI_MSI_ENB0, en);
  370. cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
  371. spin_unlock_irqrestore(&octeon_irq_msi_lock, flags);
  372. }
  373. }
  374. static struct irq_chip octeon_irq_chip_msi = {
  375. .name = "MSI",
  376. .enable = octeon_irq_msi_enable,
  377. .disable = octeon_irq_msi_disable,
  378. .ack = octeon_irq_msi_ack,
  379. .eoi = octeon_irq_msi_eoi,
  380. };
  381. #endif
  382. void __init arch_init_irq(void)
  383. {
  384. int irq;
  385. #ifdef CONFIG_SMP
  386. /* Set the default affinity to the boot cpu. */
  387. cpumask_clear(irq_default_affinity);
  388. cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
  389. #endif
  390. if (NR_IRQS < OCTEON_IRQ_LAST)
  391. pr_err("octeon_irq_init: NR_IRQS is set too low\n");
  392. /* 0 - 15 reserved for i8259 master and slave controller. */
  393. /* 17 - 23 Mips internal */
  394. for (irq = OCTEON_IRQ_SW0; irq <= OCTEON_IRQ_TIMER; irq++) {
  395. set_irq_chip_and_handler(irq, &octeon_irq_chip_core,
  396. handle_percpu_irq);
  397. }
  398. /* 24 - 87 CIU_INT_SUM0 */
  399. for (irq = OCTEON_IRQ_WORKQ0; irq <= OCTEON_IRQ_BOOTDMA; irq++) {
  400. set_irq_chip_and_handler(irq, &octeon_irq_chip_ciu0,
  401. handle_percpu_irq);
  402. }
  403. /* 88 - 151 CIU_INT_SUM1 */
  404. for (irq = OCTEON_IRQ_WDOG0; irq <= OCTEON_IRQ_RESERVED151; irq++) {
  405. set_irq_chip_and_handler(irq, &octeon_irq_chip_ciu1,
  406. handle_percpu_irq);
  407. }
  408. #ifdef CONFIG_PCI_MSI
  409. /* 152 - 215 PCI/PCIe MSI interrupts */
  410. for (irq = OCTEON_IRQ_MSI_BIT0; irq <= OCTEON_IRQ_MSI_BIT63; irq++) {
  411. set_irq_chip_and_handler(irq, &octeon_irq_chip_msi,
  412. handle_percpu_irq);
  413. }
  414. #endif
  415. set_c0_status(0x300 << 2);
  416. }
  417. asmlinkage void plat_irq_dispatch(void)
  418. {
  419. const unsigned long core_id = cvmx_get_core_num();
  420. const uint64_t ciu_sum0_address = CVMX_CIU_INTX_SUM0(core_id * 2);
  421. const uint64_t ciu_en0_address = CVMX_CIU_INTX_EN0(core_id * 2);
  422. const uint64_t ciu_sum1_address = CVMX_CIU_INT_SUM1;
  423. const uint64_t ciu_en1_address = CVMX_CIU_INTX_EN1(core_id * 2 + 1);
  424. unsigned long cop0_cause;
  425. unsigned long cop0_status;
  426. uint64_t ciu_en;
  427. uint64_t ciu_sum;
  428. while (1) {
  429. cop0_cause = read_c0_cause();
  430. cop0_status = read_c0_status();
  431. cop0_cause &= cop0_status;
  432. cop0_cause &= ST0_IM;
  433. if (unlikely(cop0_cause & STATUSF_IP2)) {
  434. ciu_sum = cvmx_read_csr(ciu_sum0_address);
  435. ciu_en = cvmx_read_csr(ciu_en0_address);
  436. ciu_sum &= ciu_en;
  437. if (likely(ciu_sum))
  438. do_IRQ(fls64(ciu_sum) + OCTEON_IRQ_WORKQ0 - 1);
  439. else
  440. spurious_interrupt();
  441. } else if (unlikely(cop0_cause & STATUSF_IP3)) {
  442. ciu_sum = cvmx_read_csr(ciu_sum1_address);
  443. ciu_en = cvmx_read_csr(ciu_en1_address);
  444. ciu_sum &= ciu_en;
  445. if (likely(ciu_sum))
  446. do_IRQ(fls64(ciu_sum) + OCTEON_IRQ_WDOG0 - 1);
  447. else
  448. spurious_interrupt();
  449. } else if (likely(cop0_cause)) {
  450. do_IRQ(fls(cop0_cause) - 9 + MIPS_CPU_IRQ_BASE);
  451. } else {
  452. break;
  453. }
  454. }
  455. }
  456. #ifdef CONFIG_HOTPLUG_CPU
  457. static int is_irq_enabled_on_cpu(unsigned int irq, unsigned int cpu)
  458. {
  459. unsigned int isset;
  460. #ifdef CONFIG_SMP
  461. int coreid = cpu_logical_map(cpu);
  462. #else
  463. int coreid = cvmx_get_core_num();
  464. #endif
  465. int bit = (irq < OCTEON_IRQ_WDOG0) ?
  466. irq - OCTEON_IRQ_WORKQ0 : irq - OCTEON_IRQ_WDOG0;
  467. if (irq < 64) {
  468. isset = (cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)) &
  469. (1ull << bit)) >> bit;
  470. } else {
  471. isset = (cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1)) &
  472. (1ull << bit)) >> bit;
  473. }
  474. return isset;
  475. }
  476. void fixup_irqs(void)
  477. {
  478. int irq;
  479. for (irq = OCTEON_IRQ_SW0; irq <= OCTEON_IRQ_TIMER; irq++)
  480. octeon_irq_core_disable_local(irq);
  481. for (irq = OCTEON_IRQ_WORKQ0; irq <= OCTEON_IRQ_GPIO15; irq++) {
  482. if (is_irq_enabled_on_cpu(irq, smp_processor_id())) {
  483. /* ciu irq migrates to next cpu */
  484. octeon_irq_chip_ciu0.disable(irq);
  485. octeon_irq_ciu0_set_affinity(irq, &cpu_online_map);
  486. }
  487. }
  488. #if 0
  489. for (irq = OCTEON_IRQ_MBOX0; irq <= OCTEON_IRQ_MBOX1; irq++)
  490. octeon_irq_mailbox_mask(irq);
  491. #endif
  492. for (irq = OCTEON_IRQ_UART0; irq <= OCTEON_IRQ_BOOTDMA; irq++) {
  493. if (is_irq_enabled_on_cpu(irq, smp_processor_id())) {
  494. /* ciu irq migrates to next cpu */
  495. octeon_irq_chip_ciu0.disable(irq);
  496. octeon_irq_ciu0_set_affinity(irq, &cpu_online_map);
  497. }
  498. }
  499. for (irq = OCTEON_IRQ_UART2; irq <= OCTEON_IRQ_RESERVED135; irq++) {
  500. if (is_irq_enabled_on_cpu(irq, smp_processor_id())) {
  501. /* ciu irq migrates to next cpu */
  502. octeon_irq_chip_ciu1.disable(irq);
  503. octeon_irq_ciu1_set_affinity(irq, &cpu_online_map);
  504. }
  505. }
  506. }
  507. #endif /* CONFIG_HOTPLUG_CPU */