public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: linux-omap@vger.kernel.org
Subject: Re: [PATCH 2/4] ARM: OMAP3: Print debug info on spurious interrupts
Date: Fri, 31 Oct 2008 13:55:52 -0700	[thread overview]
Message-ID: <20081031205552.GD28924@atomide.com> (raw)
In-Reply-To: <1225480873-30835-3-git-send-email-tony@atomide.com>

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

* Tony Lindgren <tony@atomide.com> [081031 12:21]:
> In the case of spurious interrupt, the handler for previous irq most likely
> needs a read back of some register to ensure write posting.

Here's a better version to kill the checkpatch.pl warning. Later on we
might want to add also a check for "irq == 95" to the test in
omap_mask_irq() so we can keep this patch around with minimal overhead.

Tony

[-- Attachment #2: irq-debug-v2.patch --]
[-- Type: text/x-diff, Size: 1745 bytes --]

>From 7410bd58cbf8b9d60a7b368a73b34fe03cdaa086 Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@atomide.com>
Date: Fri, 31 Oct 2008 12:01:25 -0700
Subject: [PATCH] ARM: OMAP3: Print debug info on spurious interrupts

In the case of spurious interrupt, the handler for previous irq most likely
needs to flush posted writes with a read back of the interrupt ack register.

Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 68aff9a..07aa0f5 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -23,6 +23,7 @@
 #define INTC_REVISION		0x0000
 #define INTC_SYSCONFIG		0x0010
 #define INTC_SYSSTATUS		0x0014
+#define INTC_SIR		0x0040
 #define INTC_CONTROL		0x0048
 #define INTC_MIR_CLEAR0		0x0088
 #define INTC_MIR_SET0		0x008c
@@ -60,6 +61,25 @@ static u32 intc_bank_read_reg(struct omap_irq_bank *bank, u16 reg)
 	return __raw_readl(bank->base_reg + reg);
 }
 
+static int previous_irq;
+
+static int omap_check_spurious(unsigned int irq)
+{
+	u32 sir, spurious;
+
+	sir = intc_bank_read_reg(&irq_banks[0], INTC_SIR);
+	spurious = sir >> 6;
+
+	if (spurious > 1) {
+		printk(KERN_WARNING "Spurious irq %i: 0x%08x, please flush "
+					"posted write for irq %i\n",
+					irq, sir, previous_irq);
+		return spurious;
+	}
+
+	return 0;
+}
+
 /* XXX: FIQ and additional INTC support (only MPU at the moment) */
 static void omap_ack_irq(unsigned int irq)
 {
@@ -70,6 +90,9 @@ static void omap_mask_irq(unsigned int irq)
 {
 	int offset = irq & (~(IRQ_BITS_PER_REG - 1));
 
+	if (cpu_is_omap34xx() && !omap_check_spurious(irq))
+		previous_irq = irq;
+
 	irq &= (IRQ_BITS_PER_REG - 1);
 
 	intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_SET0 + offset);

  parent reply	other threads:[~2008-10-31 20:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-31 19:21 [PATCH 0/4] 34xx spurious interrupts unravelling Tony Lindgren
2008-10-31 19:21 ` [PATCH 1/4] Revert "Add MT_MEMORY_SO, mark L3 and L4 to use it" Tony Lindgren
2008-10-31 19:21   ` [PATCH 2/4] ARM: OMAP3: Print debug info on spurious interrupts Tony Lindgren
2008-10-31 19:21     ` [PATCH 3/4] I2C: Ensure write posting for critical i2c-omap writes Tony Lindgren
2008-10-31 19:21       ` [PATCH 4/4] DSPBRIDGE: Ensure write posting when acking mailbox irq Tony Lindgren
2008-10-31 21:06         ` Tony Lindgren
2008-11-01  3:43         ` Woodruff, Richard
2008-11-02 22:10           ` Tony Lindgren
2008-11-03 18:54             ` Tony Lindgren
2008-10-31 21:03       ` [PATCH 3/4] I2C: Ensure write posting for critical i2c-omap writes Tony Lindgren
2008-10-31 20:55     ` Tony Lindgren [this message]
2008-10-31 20:07 ` [PATCH 0/4] 34xx spurious interrupts unravelling David Brownell
2008-10-31 20:35   ` Tony Lindgren
2008-10-31 21:59     ` David Brownell
2008-11-01  4:01       ` Woodruff, Richard
2008-11-01  6:08         ` David Brownell
2008-11-01 12:57           ` Woodruff, Richard
2008-11-01 21:14 ` Felipe Contreras

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=20081031205552.GD28924@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-omap@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox