630-MIPS-ath79-fix-chained-irq-disable.patch 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. --- a/arch/mips/ath79/irq.c
  2. +++ b/arch/mips/ath79/irq.c
  3. @@ -27,6 +27,9 @@
  4. #include "machtypes.h"
  5. +static struct irq_chip ip2_chip;
  6. +static struct irq_chip ip3_chip;
  7. +
  8. static void ar934x_ip2_irq_dispatch(struct irq_desc *desc)
  9. {
  10. u32 status;
  11. @@ -56,8 +59,7 @@ static void ar934x_ip2_irq_init(void)
  12. for (i = ATH79_IP2_IRQ_BASE;
  13. i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
  14. - irq_set_chip_and_handler(i, &dummy_irq_chip,
  15. - handle_level_irq);
  16. + irq_set_chip_and_handler(i, &ip2_chip, handle_level_irq);
  17. irq_set_chained_handler(ATH79_CPU_IRQ(2), ar934x_ip2_irq_dispatch);
  18. }
  19. @@ -85,7 +87,7 @@ static void qca953x_irq_init(void)
  20. for (i = ATH79_IP2_IRQ_BASE;
  21. i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
  22. - irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq);
  23. + irq_set_chip_and_handler(i, &ip2_chip, handle_level_irq);
  24. irq_set_chained_handler(ATH79_CPU_IRQ(2), qca953x_ip2_irq_dispatch);
  25. }
  26. @@ -149,15 +151,13 @@ static void qca955x_irq_init(void)
  27. for (i = ATH79_IP2_IRQ_BASE;
  28. i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
  29. - irq_set_chip_and_handler(i, &dummy_irq_chip,
  30. - handle_level_irq);
  31. + irq_set_chip_and_handler(i, &ip2_chip, handle_level_irq);
  32. irq_set_chained_handler(ATH79_CPU_IRQ(2), qca955x_ip2_irq_dispatch);
  33. for (i = ATH79_IP3_IRQ_BASE;
  34. i < ATH79_IP3_IRQ_BASE + ATH79_IP3_IRQ_COUNT; i++)
  35. - irq_set_chip_and_handler(i, &dummy_irq_chip,
  36. - handle_level_irq);
  37. + irq_set_chip_and_handler(i, &ip3_chip, handle_level_irq);
  38. irq_set_chained_handler(ATH79_CPU_IRQ(3), qca955x_ip3_irq_dispatch);
  39. }
  40. @@ -228,13 +228,13 @@ static void qca956x_irq_init(void)
  41. for (i = ATH79_IP2_IRQ_BASE;
  42. i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
  43. - irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq);
  44. + irq_set_chip_and_handler(i, &ip2_chip, handle_level_irq);
  45. irq_set_chained_handler(ATH79_CPU_IRQ(2), qca956x_ip2_irq_dispatch);
  46. for (i = ATH79_IP3_IRQ_BASE;
  47. i < ATH79_IP3_IRQ_BASE + ATH79_IP3_IRQ_COUNT; i++)
  48. - irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq);
  49. + irq_set_chip_and_handler(i, &ip3_chip, handle_level_irq);
  50. irq_set_chained_handler(ATH79_CPU_IRQ(3), qca956x_ip3_irq_dispatch);
  51. @@ -243,12 +243,40 @@ static void qca956x_irq_init(void)
  52. late_time_init = &qca956x_enable_timer_cb;
  53. }
  54. +static void ath79_ip2_disable(struct irq_data *data)
  55. +{
  56. + disable_irq(ATH79_CPU_IRQ(2));
  57. +}
  58. +
  59. +static void ath79_ip2_enable(struct irq_data *data)
  60. +{
  61. + enable_irq(ATH79_CPU_IRQ(2));
  62. +}
  63. +
  64. +static void ath79_ip3_disable(struct irq_data *data)
  65. +{
  66. + disable_irq(ATH79_CPU_IRQ(3));
  67. +}
  68. +
  69. +static void ath79_ip3_enable(struct irq_data *data)
  70. +{
  71. + enable_irq(ATH79_CPU_IRQ(3));
  72. +}
  73. +
  74. void __init arch_init_irq(void)
  75. {
  76. unsigned irq_wb_chan2 = -1;
  77. unsigned irq_wb_chan3 = -1;
  78. bool misc_is_ar71xx;
  79. + ip2_chip = dummy_irq_chip;
  80. + ip2_chip.irq_disable = ath79_ip2_disable;
  81. + ip2_chip.irq_enable = ath79_ip2_enable;
  82. +
  83. + ip3_chip = dummy_irq_chip;
  84. + ip3_chip.irq_disable = ath79_ip3_disable;
  85. + ip3_chip.irq_enable = ath79_ip3_enable;
  86. +
  87. if (mips_machtype == ATH79_MACH_GENERIC_OF) {
  88. irqchip_init();
  89. return;