From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/6] ARM: nmk: update GPIO chained IRQ handler to use EOI in parent chip
Date: Tue, 1 Mar 2011 11:57:48 +0100 (CET) [thread overview]
Message-ID: <alpine.LFD.2.00.1103011140560.2701@localhost6.localdomain6> (raw)
In-Reply-To: <20110228214445.GD1937@n2100.arm.linux.org.uk>
On Mon, 28 Feb 2011, Russell King - ARM Linux wrote:
> On Mon, Feb 28, 2011 at 08:16:25PM +0100, Thomas Gleixner wrote:
> > So what's the gain of a barebone chained handler over a regular
> > interrupt:
> >
> > - 100 instructions less
> > - lack of statistics
>
> We don't want statistics. Don't care how many times we go to look
> at the interrupt controller - and actually it's really wrong to count
> them in the first place. Counting them means that you double-count
> these interrupt events, and the more layers of interrupt controllers
> there are the worse that problem gets.
>
> So no, that's a definite argument *for* chained handers.
Errm, why do you double account them ? The accounting goes to
different irq numbers, but we could exclude them from accounting and
showing up in proc/interrupts easily.
> > - lack of affinity setting via standard interfaces
>
> Don't want affinity for them, as setting their affinity means that
> you then end up forcing the affinity for the sub-interrupts too.
> How you do cope with the high-level interrupt having affinity to
> CPU0 but a lower level interrupt being affine to CPU1 only?
>
> It's non-sensible, and is broken. So no, again this isn't an
> argument for not using chained handlers. It's an argument *for*
> them.
Well, moving the whole group to a particular cpu is sensible and the
sub interrupts don't have a set_affinity function anyway as they are
always called on the cpu on which the primary interrupt is handled.
> Sorry, but I think this stuff is right, and chained handlers like
> these have their place.
I'm not against chained handlers per se. I'm against creating a
necessarity to make a chained handler deal with various different
underlying primary irq chips and their oddities. That's simply wrong
and broken.
I don't say you have to use the existing flow handlers, if they are
too heavy weight for your purpose, but pushing conditional flow
handling into the chained handler is violating all principles of
layering.
The underlying primary chip implementation knows about the flow
requirements, so it should install the correct handler so the chained
handler just needs to deal with the sub interrupts which it knows how
to handle.
So if you don't want accounting and affinity setting (which I think is
bad), then we still can solve it in an elegant and simple way.
1) Primary chip installs a rudimentary flow handler which deals with
the requirements of the chip.
primary_handler_eoi()
{
if (desc->action)
action();
chip->irq_eoi();
}
primary_handler_level()
{
chip->irq_mask();
if (desc->action)
action();
chip->irq_unmask();
}
The interupt descriptor is marked IRQ_PRIMARY or whatever
2) Demux handler is installed via:
setup_irq(PRIMARY_IRQ, IRQ_DEMUX, demux_handler);
That's a few lines in the core code to make this work with the same
functionality than your current solution, but avoiding to touch any
demux handler when you change the underlying irq chip
implementation. It simply just works because the demux handler is
agnostic of the primary chip.
Thanks,
tglx
next prev parent reply other threads:[~2011-03-01 10:57 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-28 13:33 [PATCH v2 0/6] Migrate GIC to fasteoi flow control Will Deacon
2011-02-28 13:33 ` [PATCH 1/6] ARM: gic: use handle_fasteoi_irq for SPIs Will Deacon
2011-02-28 13:33 ` [PATCH 2/6] ARM: omap: update GPIO chained IRQ handler to use EOI in parent chip Will Deacon
2011-02-28 13:33 ` [PATCH 3/6] ARM: tegra: " Will Deacon
2011-03-01 13:11 ` Sergei Shtylyov
2011-03-01 13:24 ` Will Deacon
2011-02-28 13:33 ` [PATCH 4/6] ARM: s5pv310: update IRQ combiner " Will Deacon
2011-03-01 13:12 ` Sergei Shtylyov
2011-02-28 13:33 ` [PATCH 5/6] ARM: msm: update GPIO chained IRQ handler " Will Deacon
2011-02-28 13:33 ` [PATCH 6/6] ARM: nmk: " Will Deacon
2011-02-28 14:03 ` Russell King - ARM Linux
2011-02-28 18:09 ` Will Deacon
2011-02-28 19:16 ` Thomas Gleixner
2011-02-28 21:44 ` Russell King - ARM Linux
2011-03-01 10:57 ` Thomas Gleixner [this message]
2011-03-01 20:19 ` Russell King - ARM Linux
2011-03-01 21:29 ` Thomas Gleixner
2011-03-01 23:14 ` Russell King - ARM Linux
2011-03-01 23:44 ` Thomas Gleixner
2011-03-01 23:50 ` Russell King - ARM Linux
2011-03-02 8:53 ` Russell King - ARM Linux
2011-03-02 9:25 ` Thomas Gleixner
2011-03-02 19:17 ` Russell King - ARM Linux
2011-03-02 20:44 ` Thomas Gleixner
2011-03-02 15:33 ` Will Deacon
2011-03-02 17:10 ` Thomas Gleixner
2011-03-04 11:47 ` 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=alpine.LFD.2.00.1103011140560.2701@localhost6.localdomain6 \
--to=tglx@linutronix.de \
--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