aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorKoen Vandeputte <koen.vandeputte@ncentric.com>2019-09-11 12:22:42 +0200
committerKoen Vandeputte <koen.vandeputte@ncentric.com>2019-09-13 16:40:29 +0200
commit00d48bcac08afc5a586c074894f96d9237fbe823 (patch)
tree6ab7a0b48a9ae16234d544ac31c42f1c33c8b01d /target/linux
parent78c3a18a1e7c57fbc529f0feab60167d53edec31 (diff)
downloadupstream-00d48bcac08afc5a586c074894f96d9237fbe823.tar.gz
upstream-00d48bcac08afc5a586c074894f96d9237fbe823.tar.bz2
upstream-00d48bcac08afc5a586c074894f96d9237fbe823.zip
ar71xx: Fix potentially missed IRQ handling during dispatch
If both interrupts are set in the current implementation only the 1st will be handled and the 2nd will be skipped due to the "if else" condition. Fix this by using the same approach as done for QCA955x just below it. Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/generic/pending-4.14/343-MIPS-ath79-Fix-potentially-missed-IRQ-handling-durin.patch57
-rw-r--r--target/linux/generic/pending-4.19/343-MIPS-ath79-Fix-potentially-missed-IRQ-handling-durin.patch57
2 files changed, 114 insertions, 0 deletions
diff --git a/target/linux/generic/pending-4.14/343-MIPS-ath79-Fix-potentially-missed-IRQ-handling-durin.patch b/target/linux/generic/pending-4.14/343-MIPS-ath79-Fix-potentially-missed-IRQ-handling-durin.patch
new file mode 100644
index 0000000000..b1389bc28d
--- /dev/null
+++ b/target/linux/generic/pending-4.14/343-MIPS-ath79-Fix-potentially-missed-IRQ-handling-durin.patch
@@ -0,0 +1,57 @@
+From 3fe7841bf5a582dc7fd198e5bf70162ea418a22a Mon Sep 17 00:00:00 2001
+From: Koen Vandeputte <koen.vandeputte@ncentric.com>
+Date: Wed, 11 Sep 2019 11:02:19 +0200
+Subject: [PATCH] MIPS: ath79: Fix potentially missed IRQ handling during
+ dispatch
+
+If both interrupts are set in the current implementation
+only the 1st will be handled and the 2nd will be skipped
+due to the "if else" condition.
+
+Fix this by using the same approach as done for QCA955x
+just below it.
+
+Fixes: fce5cc6e0ddc ("MIPS: ath79: add IRQ handling code for AR934X")
+Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
+CC: Felix Fietkau <nbd@nbd.name>
+CC: Gabor Juhos <juhosg@freemail.hu>
+CC: James Hogan <jhogan@kernel.org>
+CC: Paul Burton <paul.burton@mips.com>
+CC: Ralf Baechle <ralf@linux-mips.org>
+CC: stable@vger.kernel.org # v3.2+
+---
+ arch/mips/ath79/irq.c | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/arch/mips/ath79/irq.c b/arch/mips/ath79/irq.c
+index 2dfff1f19004..a03a6bcaf6fd 100644
+--- a/arch/mips/ath79/irq.c
++++ b/arch/mips/ath79/irq.c
+@@ -32,15 +32,21 @@ static void ar934x_ip2_irq_dispatch(struct irq_desc *desc)
+ u32 status;
+
+ status = ath79_reset_rr(AR934X_RESET_REG_PCIE_WMAC_INT_STATUS);
++ status &= AR934X_PCIE_WMAC_INT_PCIE_ALL | AR934X_PCIE_WMAC_INT_WMAC_ALL;
++
++ if (status == 0) {
++ spurious_interrupt();
++ return;
++ }
+
+ if (status & AR934X_PCIE_WMAC_INT_PCIE_ALL) {
+ ath79_ddr_wb_flush(3);
+ generic_handle_irq(ATH79_IP2_IRQ(0));
+- } else if (status & AR934X_PCIE_WMAC_INT_WMAC_ALL) {
++ }
++
++ if (status & AR934X_PCIE_WMAC_INT_WMAC_ALL) {
+ ath79_ddr_wb_flush(4);
+ generic_handle_irq(ATH79_IP2_IRQ(1));
+- } else {
+- spurious_interrupt();
+ }
+ }
+
+--
+2.17.1
+
diff --git a/target/linux/generic/pending-4.19/343-MIPS-ath79-Fix-potentially-missed-IRQ-handling-durin.patch b/target/linux/generic/pending-4.19/343-MIPS-ath79-Fix-potentially-missed-IRQ-handling-durin.patch
new file mode 100644
index 0000000000..b1389bc28d
--- /dev/null
+++ b/target/linux/generic/pending-4.19/343-MIPS-ath79-Fix-potentially-missed-IRQ-handling-durin.patch
@@ -0,0 +1,57 @@
+From 3fe7841bf5a582dc7fd198e5bf70162ea418a22a Mon Sep 17 00:00:00 2001
+From: Koen Vandeputte <koen.vandeputte@ncentric.com>
+Date: Wed, 11 Sep 2019 11:02:19 +0200
+Subject: [PATCH] MIPS: ath79: Fix potentially missed IRQ handling during
+ dispatch
+
+If both interrupts are set in the current implementation
+only the 1st will be handled and the 2nd will be skipped
+due to the "if else" condition.
+
+Fix this by using the same approach as done for QCA955x
+just below it.
+
+Fixes: fce5cc6e0ddc ("MIPS: ath79: add IRQ handling code for AR934X")
+Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
+CC: Felix Fietkau <nbd@nbd.name>
+CC: Gabor Juhos <juhosg@freemail.hu>
+CC: James Hogan <jhogan@kernel.org>
+CC: Paul Burton <paul.burton@mips.com>
+CC: Ralf Baechle <ralf@linux-mips.org>
+CC: stable@vger.kernel.org # v3.2+
+---
+ arch/mips/ath79/irq.c | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/arch/mips/ath79/irq.c b/arch/mips/ath79/irq.c
+index 2dfff1f19004..a03a6bcaf6fd 100644
+--- a/arch/mips/ath79/irq.c
++++ b/arch/mips/ath79/irq.c
+@@ -32,15 +32,21 @@ static void ar934x_ip2_irq_dispatch(struct irq_desc *desc)
+ u32 status;
+
+ status = ath79_reset_rr(AR934X_RESET_REG_PCIE_WMAC_INT_STATUS);
++ status &= AR934X_PCIE_WMAC_INT_PCIE_ALL | AR934X_PCIE_WMAC_INT_WMAC_ALL;
++
++ if (status == 0) {
++ spurious_interrupt();
++ return;
++ }
+
+ if (status & AR934X_PCIE_WMAC_INT_PCIE_ALL) {
+ ath79_ddr_wb_flush(3);
+ generic_handle_irq(ATH79_IP2_IRQ(0));
+- } else if (status & AR934X_PCIE_WMAC_INT_WMAC_ALL) {
++ }
++
++ if (status & AR934X_PCIE_WMAC_INT_WMAC_ALL) {
+ ath79_ddr_wb_flush(4);
+ generic_handle_irq(ATH79_IP2_IRQ(1));
+- } else {
+- spurious_interrupt();
+ }
+ }
+
+--
+2.17.1
+