public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: linux-omap@vger.kernel.org, Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Subject: [PATCH 02/10] ARM: OMAP: McBSP: Fix legacy interrupts to clear their status
Date: Tue, 19 May 2009 16:33:30 -0700	[thread overview]
Message-ID: <20090519233330.12760.24949.stgit@localhost> (raw)
In-Reply-To: <20090519232905.12760.15490.stgit@localhost>

From: Eero Nurkkala <ext-eero.nurkkala@nokia.com>

If XSYNCERR or RSYNCERR interrupts are enabled, they are never
cleared causing the IRQ handler to be continuously called.
This patch clears the IRQs in question in the event they are
enabled and taken.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/plat-omap/mcbsp.c |   30 ++++++++++++++++++++++++------
 1 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index 28b0a82..efa0e01 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -91,11 +91,20 @@ static void omap_mcbsp_dump_reg(u8 id)
 static irqreturn_t omap_mcbsp_tx_irq_handler(int irq, void *dev_id)
 {
 	struct omap_mcbsp *mcbsp_tx = dev_id;
+	u16 irqst_spcr2;
 
-	dev_dbg(mcbsp_tx->dev, "TX IRQ callback : 0x%x\n",
-		OMAP_MCBSP_READ(mcbsp_tx->io_base, SPCR2));
+	irqst_spcr2 = OMAP_MCBSP_READ(mcbsp_tx->io_base, SPCR2);
+	dev_dbg(mcbsp_tx->dev, "TX IRQ callback : 0x%x\n", irqst_spcr2);
 
-	complete(&mcbsp_tx->tx_irq_completion);
+	if (irqst_spcr2 & XSYNC_ERR) {
+		dev_err(mcbsp_tx->dev, "TX Frame Sync Error! : 0x%x\n",
+			irqst_spcr2);
+		/* Writing zero to XSYNC_ERR clears the IRQ */
+		OMAP_MCBSP_WRITE(mcbsp_tx->io_base, SPCR2,
+			irqst_spcr2 & ~(XSYNC_ERR));
+	} else {
+		complete(&mcbsp_tx->tx_irq_completion);
+	}
 
 	return IRQ_HANDLED;
 }
@@ -103,11 +112,20 @@ static irqreturn_t omap_mcbsp_tx_irq_handler(int irq, void *dev_id)
 static irqreturn_t omap_mcbsp_rx_irq_handler(int irq, void *dev_id)
 {
 	struct omap_mcbsp *mcbsp_rx = dev_id;
+	u16 irqst_spcr1;
 
-	dev_dbg(mcbsp_rx->dev, "RX IRQ callback : 0x%x\n",
-		OMAP_MCBSP_READ(mcbsp_rx->io_base, SPCR2));
+	irqst_spcr1 = OMAP_MCBSP_READ(mcbsp_rx->io_base, SPCR1);
+	dev_dbg(mcbsp_rx->dev, "RX IRQ callback : 0x%x\n", irqst_spcr1);
 
-	complete(&mcbsp_rx->rx_irq_completion);
+	if (irqst_spcr1 & RSYNC_ERR) {
+		dev_err(mcbsp_rx->dev, "RX Frame Sync Error! : 0x%x\n",
+			irqst_spcr1);
+		/* Writing zero to RSYNC_ERR clears the IRQ */
+		OMAP_MCBSP_WRITE(mcbsp_rx->io_base, SPCR1,
+			irqst_spcr1 & ~(RSYNC_ERR));
+	} else {
+		complete(&mcbsp_rx->tx_irq_completion);
+	}
 
 	return IRQ_HANDLED;
 }


  parent reply	other threads:[~2009-05-19 23:33 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19 23:30 [PATCH 00/10] Omap updates for merge window after 2.6.30 Tony Lindgren
2009-05-19 23:32 ` [PATCH 01/10] ARM: OMAP: Increase VMALLOC_END to allow 256MB RAM Tony Lindgren
2009-05-19 23:33 ` Tony Lindgren [this message]
2009-05-19 23:34 ` [PATCH 03/10] ARM: OMAP: Update contact address of I2C registration helper Tony Lindgren
2009-05-25  9:23   ` Russell King - ARM Linux
2009-05-25 11:32     ` Jarkko Nikula
2009-05-25 16:23       ` Tony Lindgren
2009-05-19 23:36 ` [PATCH 04/10] ARM: OMAP1: Misc clean-up Tony Lindgren
2009-05-19 23:37 ` [PATCH 05/10] ARM: OMAP1: Make 770 LCD work Tony Lindgren
2009-05-25  9:29   ` Russell King - ARM Linux
2009-05-25 13:21     ` Andrew de Quincey
2009-05-25 16:40       ` Andrew de Quincey
2009-05-28 18:20         ` Tony Lindgren
2009-05-28 18:44           ` Andrew de Quincey
2009-05-28 19:11             ` [PATCH 05/10] ARM: OMAP1: Make 770 LCD work, v2 Tony Lindgren
2009-05-28 21:03               ` [PATCH 05/10] ARM: OMAP1: Make 770 LCD work, v3 Tony Lindgren
2009-05-28 19:50           ` [PATCH 05/10] ARM: OMAP1: Make 770 LCD work Russell King - ARM Linux
2009-05-29  0:29             ` Andrew de Quincey
2009-06-01 13:57               ` Kalle Valo
2009-05-28 19:53           ` Russell King - ARM Linux
2009-05-28 21:02             ` [PATCH] ARM: Move clk_add_alias() to arch/arm/common/clkdev.c (Re: [PATCH 05/10] ARM: OMAP1: Make 770 LCD work) Tony Lindgren
2009-06-03 16:44               ` Tony Lindgren
2009-05-19 23:38 ` [PATCH 06/10] ARM: OMAP2/3: DMA: implement trans copy and const fill Tony Lindgren
2009-05-19 23:40 ` [PATCH 07/10] ARM: OMAP2/3: sDMA: Correct omap_request_dma_chain() Tony Lindgren
2009-05-25  9:34   ` Russell King - ARM Linux
2009-05-25  9:40     ` Shilimkar, Santosh
2009-05-25 16:28       ` [PATCH 07/10] ARM: OMAP2/3: sDMA: Correct omap_request_dma_chain(), v2 Tony Lindgren
2009-05-26  4:55         ` Shilimkar, Santosh
2009-05-19 23:41 ` [PATCH 08/10] ARM: OMAP2/3: Add generic onenand support when connected to GPMC Tony Lindgren
2009-05-25  9:43   ` Russell King - ARM Linux
2009-05-25 16:50     ` [PATCH 08/10] ARM: OMAP2/3: Add generic onenand support when connected to GPMC, v2 Tony Lindgren
2009-05-19 23:42 ` [PATCH 09/10] ARM: OMAP2/3: Add generic smc91x support when connected to GPMC Tony Lindgren
2009-05-25  9:46   ` Russell King - ARM Linux
2009-05-25 16:59     ` [PATCH 09/10] ARM: OMAP2/3: Add generic smc91x support when connected to GPMC, v2 Tony Lindgren
2009-05-19 23:44 ` [PATCH 10/10] ARM: OMAP2: 2430SDP: Add FB support to board file Tony Lindgren
2009-05-25 17:42   ` [PATCH 11/10] ARM: OMAP: Add some entries to MAINTAINERS Tony Lindgren
2009-05-26 23:18 ` [PATCH 00/10] Omap updates for merge window after 2.6.30 Tony Lindgren

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=20090519233330.12760.24949.stgit@localhost \
    --to=tony@atomide.com \
    --cc=ext-eero.nurkkala@nokia.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --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