All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amit Pundir <amit.pundir@linaro.org>
To: stable@vger.kernel.org
Cc: gregkh@linuxfoundation.org, Felix Fietkau <nbd@nbd.name>,
	linux-mips@linux-mips.org, James Hogan <james.hogan@imgtec.com>
Subject: [PATCH v2 for-4.9 04/32] MIPS: Lantiq: Fix cascaded IRQ setup
Date: Wed,  5 Apr 2017 16:01:56 +0530	[thread overview]
Message-ID: <1491388344-13521-5-git-send-email-amit.pundir@linaro.org> (raw)
In-Reply-To: <1491388344-13521-1-git-send-email-amit.pundir@linaro.org>

From: Felix Fietkau <nbd@nbd.name>

With the IRQ stack changes integrated, the XRX200 devices started
emitting a constant stream of kernel messages like this:

[  565.415310] Spurious IRQ: CAUSE=0x1100c300

This is caused by IP0 getting handled by plat_irq_dispatch() rather than
its vectored interrupt handler, which is fixed by commit de856416e714
("MIPS: IRQ Stack: Fix erroneous jal to plat_irq_dispatch").

Fix plat_irq_dispatch() to handle non-vectored IPI interrupts correctly
by setting up IP2-6 as proper chained IRQ handlers and calling do_IRQ
for all MIPS CPU interrupts.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Acked-by: John Crispin <john@phrozen.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15077/
[james.hogan@imgtec.com: tweaked commit message]
Signed-off-by: James Hogan <james.hogan@imgtec.com>

(cherry picked from commit 6c356eda225e3ee134ed4176b9ae3a76f793f4dd)
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
 arch/mips/lantiq/irq.c | 38 +++++++++++++++++---------------------
 1 file changed, 17 insertions(+), 21 deletions(-)

diff --git a/arch/mips/lantiq/irq.c b/arch/mips/lantiq/irq.c
index 8ac0e59..0ddf369 100644
--- a/arch/mips/lantiq/irq.c
+++ b/arch/mips/lantiq/irq.c
@@ -269,6 +269,11 @@ static void ltq_hw5_irqdispatch(void)
 DEFINE_HWx_IRQDISPATCH(5)
 #endif
 
+static void ltq_hw_irq_handler(struct irq_desc *desc)
+{
+	ltq_hw_irqdispatch(irq_desc_get_irq(desc) - 2);
+}
+
 #ifdef CONFIG_MIPS_MT_SMP
 void __init arch_init_ipiirq(int irq, struct irqaction *action)
 {
@@ -313,23 +318,19 @@ static struct irqaction irq_call = {
 asmlinkage void plat_irq_dispatch(void)
 {
 	unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
-	unsigned int i;
-
-	if ((MIPS_CPU_TIMER_IRQ == 7) && (pending & CAUSEF_IP7)) {
-		do_IRQ(MIPS_CPU_TIMER_IRQ);
-		goto out;
-	} else {
-		for (i = 0; i < MAX_IM; i++) {
-			if (pending & (CAUSEF_IP2 << i)) {
-				ltq_hw_irqdispatch(i);
-				goto out;
-			}
-		}
+	int irq;
+
+	if (!pending) {
+		spurious_interrupt();
+		return;
 	}
-	pr_alert("Spurious IRQ: CAUSE=0x%08x\n", read_c0_status());
 
-out:
-	return;
+	pending >>= CAUSEB_IP;
+	while (pending) {
+		irq = fls(pending) - 1;
+		do_IRQ(MIPS_CPU_IRQ_BASE + irq);
+		pending &= ~BIT(irq);
+	}
 }
 
 static int icu_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
@@ -354,11 +355,6 @@ static const struct irq_domain_ops irq_domain_ops = {
 	.map = icu_map,
 };
 
-static struct irqaction cascade = {
-	.handler = no_action,
-	.name = "cascade",
-};
-
 int __init icu_of_init(struct device_node *node, struct device_node *parent)
 {
 	struct device_node *eiu_node;
@@ -390,7 +386,7 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent)
 	mips_cpu_irq_init();
 
 	for (i = 0; i < MAX_IM; i++)
-		setup_irq(i + 2, &cascade);
+		irq_set_chained_handler(i + 2, ltq_hw_irq_handler);
 
 	if (cpu_has_vint) {
 		pr_info("Setting up vectored interrupts\n");
-- 
2.7.4

  parent reply	other threads:[~2017-04-05 10:32 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-05 10:31 [PATCH v2 for-4.9 00/32] Stable commits picked up from lede project Amit Pundir
2017-04-05 10:31 ` [PATCH v2 for-4.9 01/32] ARM: BCM5301X: Add back handler ignoring external imprecise aborts Amit Pundir
2017-04-05 10:31 ` [PATCH v2 for-4.9 02/32] ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags Amit Pundir
2017-04-06  7:33   ` Greg KH
2017-04-05 10:31 ` [PATCH v2 for-4.9 03/32] PCI: iproc: Save host bridge window resource in struct iproc_pcie Amit Pundir
2017-04-06  7:33   ` Greg KH
2017-04-05 10:31 ` Amit Pundir [this message]
2017-04-06  7:34   ` [PATCH v2 for-4.9 04/32] MIPS: Lantiq: Fix cascaded IRQ setup Greg KH
2017-04-06  9:29   ` James Hogan
2017-04-06  9:29     ` James Hogan
2017-04-06 10:53     ` Amit Pundir
2017-04-06 11:25       ` James Hogan
2017-04-06 11:25         ` James Hogan
2017-04-06 11:44         ` Amit Pundir
2017-04-05 10:31 ` [PATCH v2 for-4.9 05/32] i2c: bcm2835: Fix hang for writing messages larger than 16 bytes Amit Pundir
2017-04-05 10:31 ` [PATCH v2 for-4.9 06/32] i2c: bcm2835: Protect against unexpected TXW/RXR interrupts Amit Pundir
2017-04-05 10:31 ` [PATCH v2 for-4.9 07/32] i2c: bcm2835: Use dev_dbg logging on transfer errors Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 08/32] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 09/32] clk: bcm: Support rate change propagation on bcm2835 clocks Amit Pundir
2017-04-12 13:17   ` Greg KH
2017-04-12 13:33     ` Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 10/32] clk: bcm: Allow rate change propagation to PLLH_AUX on VEC clock Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 11/32] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate() Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 12/32] clk: bcm2835: Don't rate change PLLs on behalf of DSI PLL dividers Amit Pundir
2017-04-06 16:53   ` Eric Anholt
2017-04-05 10:32 ` [PATCH v2 for-4.9 13/32] clk: bcm2835: Register the DSI0/DSI1 pixel clocks Amit Pundir
2017-04-12 13:15   ` Greg KH
2017-04-05 10:32 ` [PATCH v2 for-4.9 14/32] clk: bcm2835: Add leaf clock measurement support, disabled by default Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 15/32] dmaengine: bcm2835: Fix cyclic DMA period splitting Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 16/32] usb: dwc2: Remove unnecessary kfree Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 17/32] mtd: bcm47xxpart: fix parsing first block after aligned TRX Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 18/32] net: add devm version of alloc_etherdev_mqs function Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 19/32] net: bgmac: allocate struct bgmac just once & don't copy it Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 20/32] net: bgmac: drop struct bcma_mdio we don't need anymore Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 21/32] of: Add check to of_scan_flat_dt() before accessing initial_boot_params Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 22/32] rt2500usb: don't mark register accesses as inline Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 23/32] brcmfmac: check brcmf_bus_get_memdump result for error Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 24/32] brcmfmac: be more verbose when PSM's watchdog fires Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 25/32] brcmfmac: merge two brcmf_err macros into one Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 26/32] brcmfmac: switch to C function (__brcmf_err) for printing errors Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 27/32] brcmfmac: merge two remaining brcmf_err macros Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 28/32] rt2x00usb: do not anchor rx and tx urb's Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 29/32] rt2x00usb: fix anchor initialization Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 30/32] brcmfmac: Use net_device_stats from struct net_device Amit Pundir
2017-04-12 13:18   ` Greg KH
2017-04-12 13:46     ` Tobias Klauser
2017-04-12 13:52     ` Kalle Valo
2017-04-12 14:29       ` Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 31/32] rt2x00: Fix incorrect usage of CONFIG_RT2X00_LIB_USB Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 32/32] rt2x00: avoid introducing a USB dependency in the rt2x00lib module Amit Pundir
2017-04-06  7:29 ` [PATCH v2 for-4.9 00/32] Stable commits picked up from lede project Greg KH
2017-04-06  7:44   ` Amit Pundir

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491388344-13521-5-git-send-email-amit.pundir@linaro.org \
    --to=amit.pundir@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=james.hogan@imgtec.com \
    --cc=linux-mips@linux-mips.org \
    --cc=nbd@nbd.name \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.