linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [BUG?] vic MULTI_IRQ_HANDLER (was [PATCH] ep93xx: Implement double buffering for M2M DMA channels)
Date: Tue, 3 Apr 2012 18:08:12 +0100	[thread overview]
Message-ID: <20120403170812.GR17741@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <20120402214614.GK24211@n2100.arm.linux.org.uk>

On Mon, Apr 02, 2012 at 10:46:14PM +0100, Russell King - ARM Linux wrote:
> On Mon, Apr 02, 2012 at 11:00:34PM +0300, Mika Westerberg wrote:
> > Anyway it looks like handle_IRQ() enables interrupts when it is finished with
> > the current interrupt which then causes hw to interrupt second time resulting
> > failure in case of ep93xx.
> 
> Soft IRQ processing in the irq exit path will enable interrupts, and
> this is probably where the problem is showing up.
> 
> You've identified an important difference between the level 1 interrupt
> controller handlers and the chained handlers, and I suggest that folk
> re-implement their level 1 interrupt handlers in the same way as the
> assembly code was: re-read the interrupt register each time round the
> loop.

I'm also seeing this on the Versatile AB, with spurious interrupts reported
from eth0.

As you suggested, re-reading the VIC status solves the problem:


diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index dcb004a..cb6b49a 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -441,11 +441,9 @@ static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)
        u32 stat, irq;
        int handled = 0;
 
-       stat = readl_relaxed(vic->base + VIC_IRQ_STATUS);
-       while (stat) {
+       while ((stat = readl_relaxed(vic->base + VIC_IRQ_STATUS))) {
                irq = ffs(stat) - 1;
                handle_IRQ(irq_domain_to_irq(&vic->domain, irq), regs);
-               stat &= ~(1 << irq);
                handled = 1;
        }


Will

  reply	other threads:[~2012-04-03 17:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-02 17:55 [BUG?] vic MULTI_IRQ_HANDLER (was [PATCH] ep93xx: Implement double buffering for M2M DMA channels) H Hartley Sweeten
2012-04-02 18:16 ` Jamie Iles
2012-04-02 18:27   ` H Hartley Sweeten
2012-04-02 18:37     ` Jamie Iles
2012-04-02 20:00   ` Mika Westerberg
2012-04-02 21:46     ` Russell King - ARM Linux
2012-04-03 17:08       ` Will Deacon [this message]
2012-04-03 17:43         ` Mika Westerberg
2012-04-03 17:46         ` H Hartley Sweeten
2012-04-04  9:11           ` Will Deacon
2012-04-04  9:12             ` Jamie Iles
2012-04-04 10:25               ` Will Deacon

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=20120403170812.GR17741@mudshark.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).