linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [ PATCH ] PowerPC cascade UIC IRQ handler fix.
Date: Fri, 3 Aug 2007 14:57:05 +1000	[thread overview]
Message-ID: <20070803045705.GA2392@localhost.localdomain> (raw)
In-Reply-To: <1186103889.5495.650.camel@localhost.localdomain>

On Fri, Aug 03, 2007 at 11:18:09AM +1000, Benjamin Herrenschmidt wrote:
> On Thu, 2007-08-02 at 13:48 +1000, David Gibson wrote:
> > On Mon, Jul 30, 2007 at 08:35:17PM +0400, Valentine Barshak wrote:
> > > PPC44x cascade UIC irq handler fix.
> > > 
> > > According to PPC44x UM, if an interrupt is configured as level-sensitive,
> > > and a clear is attempted on the UIC_SR, the UIC_SR field is not
> > > cleared if the incoming interrupt signal is at the asserted polarity.
> > > This causes us to enter a cascade handler twice, since we first ack
> > > parent UIC interrupt and ack child UIC one after that.
> > > The patch checks child UIC msr value and returns IRQ_HANDLED
> > > if there're no pending interrupts. Otherwise we get a kernel panic
> > > with a "Fatal exception in interrupt" (illegal vector).
> > > The patch also fixes status flags.
> > > 
> > > Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
> > 
> > Hrm... This doesn't seem like the right fix to me.  Instead, I think
> > the cascaded IRQ handler should ack the interrupt on the child first.
> > I'm a little surprised it doesn't at the moment.
> 
> Well, we certainly do also need to make the code more solid vs.
> spurrious interrupts.

Actually that's true.  The suggested patch is a good improvement for
general robustness, but doesn't actually address the real problem.

> The main thing is, if the cascade is a level interrupt, it should
> probably use a smarter cascade handler that masks it, handle the child
> interrupts, then unmasks it.

We already have that, since I just use setup_irq() to set up a cascade
handler, rather than a custom flow handler.

The problem is that the standard handle_level_irq() flow handler acks
before the ISR is called, whereas because of this UIC behaviour, we
need to ack after the ISR has cleared the interrupt in the source.
This is not specific to cascades, but is a problem for all
level-triggered interrupts (i.e. basically everything).

I think it means we must currently be getting a whole lot of spurious
interrupts - will do some investigation in a moment.

To fix this either we'll need a custom flow handler for UIC, or we can
use the standard one, but clear the UIC_SR bits from the ->unmask()
callback for level interrupts.  I'm not entirely sure if the latter
approach is safe - I *think* it is, but I could do with more
convincing.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

  reply	other threads:[~2007-08-03  4:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-30 16:35 [ PATCH ] PowerPC cascade UIC IRQ handler fix Valentine Barshak
2007-08-02  3:48 ` David Gibson
2007-08-02 20:08   ` Josh Boyer
2007-08-03 11:09     ` Valentine Barshak
2007-08-03  1:18   ` Benjamin Herrenschmidt
2007-08-03  4:57     ` David Gibson [this message]
2007-08-03  6:23       ` David Gibson
2007-08-13  1:08         ` David Gibson
2007-08-13 12:31           ` Valentine Barshak
2007-08-14  1:35             ` David Gibson

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=20070803045705.GA2392@localhost.localdomain \
    --to=david@gibson.dropbear.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.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).