1
0

343-MIPS-ath79-Fix-potentially-missed-IRQ-handling-durin.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. From 3fe7841bf5a582dc7fd198e5bf70162ea418a22a Mon Sep 17 00:00:00 2001
  2. From: Koen Vandeputte <koen.vandeputte@ncentric.com>
  3. Date: Wed, 11 Sep 2019 11:02:19 +0200
  4. Subject: [PATCH] MIPS: ath79: Fix potentially missed IRQ handling during
  5. dispatch
  6. If both interrupts are set in the current implementation
  7. only the 1st will be handled and the 2nd will be skipped
  8. due to the "if else" condition.
  9. Fix this by using the same approach as done for QCA955x
  10. just below it.
  11. Fixes: fce5cc6e0ddc ("MIPS: ath79: add IRQ handling code for AR934X")
  12. Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
  13. CC: Felix Fietkau <nbd@nbd.name>
  14. CC: Gabor Juhos <juhosg@freemail.hu>
  15. CC: James Hogan <jhogan@kernel.org>
  16. CC: Paul Burton <paul.burton@mips.com>
  17. CC: Ralf Baechle <ralf@linux-mips.org>
  18. CC: stable@vger.kernel.org # v3.2+
  19. ---
  20. arch/mips/ath79/irq.c | 12 +++++++++---
  21. 1 file changed, 9 insertions(+), 3 deletions(-)
  22. --- a/arch/mips/ath79/irq.c
  23. +++ b/arch/mips/ath79/irq.c
  24. @@ -32,15 +32,21 @@ static void ar934x_ip2_irq_dispatch(stru
  25. u32 status;
  26. status = ath79_reset_rr(AR934X_RESET_REG_PCIE_WMAC_INT_STATUS);
  27. + status &= AR934X_PCIE_WMAC_INT_PCIE_ALL | AR934X_PCIE_WMAC_INT_WMAC_ALL;
  28. +
  29. + if (status == 0) {
  30. + spurious_interrupt();
  31. + return;
  32. + }
  33. if (status & AR934X_PCIE_WMAC_INT_PCIE_ALL) {
  34. ath79_ddr_wb_flush(3);
  35. generic_handle_irq(ATH79_IP2_IRQ(0));
  36. - } else if (status & AR934X_PCIE_WMAC_INT_WMAC_ALL) {
  37. + }
  38. +
  39. + if (status & AR934X_PCIE_WMAC_INT_WMAC_ALL) {
  40. ath79_ddr_wb_flush(4);
  41. generic_handle_irq(ATH79_IP2_IRQ(1));
  42. - } else {
  43. - spurious_interrupt();
  44. }
  45. }