030-MIPS-Always-use-IRQ-domains-for-CPU-IRQs.patch 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. From 0f84c305351c993e4307e1e8c128d44760314e31 Mon Sep 17 00:00:00 2001
  2. From: Andrew Bresticker <abrestic@chromium.org>
  3. Date: Thu, 18 Sep 2014 14:47:07 -0700
  4. Subject: [PATCH 1/3] MIPS: Always use IRQ domains for CPU IRQs
  5. Use an IRQ domain for the 8 CPU IRQs in both the DT and non-DT cases.
  6. Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
  7. Reviewed-by: Qais Yousef <qais.yousef@imgtec.com>
  8. Tested-by: Qais Yousef <qais.yousef@imgtec.com>
  9. Cc: Thomas Gleixner <tglx@linutronix.de>
  10. Cc: Jason Cooper <jason@lakedaemon.net>
  11. Cc: Andrew Bresticker <abrestic@chromium.org>
  12. Cc: Jeffrey Deans <jeffrey.deans@imgtec.com>
  13. Cc: Markos Chandras <markos.chandras@imgtec.com>
  14. Cc: Paul Burton <paul.burton@imgtec.com>
  15. Cc: Qais Yousef <qais.yousef@imgtec.com>
  16. Cc: Jonas Gorski <jogo@openwrt.org>
  17. Cc: John Crispin <blogic@openwrt.org>
  18. Cc: David Daney <ddaney.cavm@gmail.com>
  19. Cc: linux-mips@linux-mips.org
  20. Cc: linux-kernel@vger.kernel.org
  21. Patchwork: https://patchwork.linux-mips.org/patch/7799/
  22. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  23. ---
  24. arch/mips/Kconfig | 1 +
  25. arch/mips/kernel/irq_cpu.c | 36 +++++++++++-------------------------
  26. 2 files changed, 12 insertions(+), 25 deletions(-)
  27. --- a/arch/mips/Kconfig
  28. +++ b/arch/mips/Kconfig
  29. @@ -1056,6 +1056,7 @@ config MIPS_HUGE_TLB_SUPPORT
  30. config IRQ_CPU
  31. bool
  32. + select IRQ_DOMAIN
  33. config IRQ_CPU_RM7K
  34. bool
  35. --- a/arch/mips/kernel/irq_cpu.c
  36. +++ b/arch/mips/kernel/irq_cpu.c
  37. @@ -98,28 +98,6 @@ static struct irq_chip mips_mt_cpu_irq_c
  38. .irq_enable = unmask_mips_irq,
  39. };
  40. -void __init mips_cpu_irq_init(void)
  41. -{
  42. - int irq_base = MIPS_CPU_IRQ_BASE;
  43. - int i;
  44. -
  45. - /* Mask interrupts. */
  46. - clear_c0_status(ST0_IM);
  47. - clear_c0_cause(CAUSEF_IP);
  48. -
  49. - /* Software interrupts are used for MT/CMT IPI */
  50. - for (i = irq_base; i < irq_base + 2; i++)
  51. - irq_set_chip_and_handler(i, cpu_has_mipsmt ?
  52. - &mips_mt_cpu_irq_controller :
  53. - &mips_cpu_irq_controller,
  54. - handle_percpu_irq);
  55. -
  56. - for (i = irq_base + 2; i < irq_base + 8; i++)
  57. - irq_set_chip_and_handler(i, &mips_cpu_irq_controller,
  58. - handle_percpu_irq);
  59. -}
  60. -
  61. -#ifdef CONFIG_IRQ_DOMAIN
  62. static int mips_cpu_intc_map(struct irq_domain *d, unsigned int irq,
  63. irq_hw_number_t hw)
  64. {
  65. @@ -142,8 +120,7 @@ static const struct irq_domain_ops mips_
  66. .xlate = irq_domain_xlate_onecell,
  67. };
  68. -int __init mips_cpu_intc_init(struct device_node *of_node,
  69. - struct device_node *parent)
  70. +static void __init __mips_cpu_irq_init(struct device_node *of_node)
  71. {
  72. struct irq_domain *domain;
  73. @@ -155,7 +132,16 @@ int __init mips_cpu_intc_init(struct dev
  74. &mips_cpu_intc_irq_domain_ops, NULL);
  75. if (!domain)
  76. panic("Failed to add irqdomain for MIPS CPU");
  77. +}
  78. +void __init mips_cpu_irq_init(void)
  79. +{
  80. + __mips_cpu_irq_init(NULL);
  81. +}
  82. +
  83. +int __init mips_cpu_intc_init(struct device_node *of_node,
  84. + struct device_node *parent)
  85. +{
  86. + __mips_cpu_irq_init(of_node);
  87. return 0;
  88. }
  89. -#endif /* CONFIG_IRQ_DOMAIN */