From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
Andrew Lunn <andrew@lunn.ch>, Jason Cooper <jason@lakedaemon.net>,
linux-kernel@vger.kernel.org,
Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
Gregory Clement <gregory.clement@free-electrons.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/3] irqchip: orion: clear stale interrupts in irq_enable
Date: Fri, 24 Jan 2014 10:55:39 +0000 [thread overview]
Message-ID: <20140124105539.GD15937@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20140123225208.GA24778@obsidianresearch.com>
On Thu, Jan 23, 2014 at 03:52:08PM -0700, Jason Gunthorpe wrote:
> On Thu, Jan 23, 2014 at 11:38:06PM +0100, Sebastian Hesselbarth wrote:
> > Bridge IRQ_CAUSE bits are asserted regardless of the corresponding bit in
> > IRQ_MASK register. To avoid interrupt events on stale irqs, we have to clear
> > them before unmask. This installs an .irq_enable callback to ensure stale
> > irqs are cleared before initial unmask.
>
> I'm not sure if putting this in irq_enable is correct. I think this
> should only happen at irq_startup.
>
> The question boils down to what is supposed to happen with this code
> sequence:
>
> disable_irq(..);
> write(.. something to cause an interrupt edge ..);
> .. synchronize ..
> enable_irq(..);
>
> Do we get the interrupt or not?
The answer is... yes, the interrupt should be delivered after the
interrupt is re-enabled.
> I found this message from Linus long ago:
> http://yarchive.net/comp/linux/edge_triggered_interrupts.html
> > Btw, the "disable_irq()/enable_irq()" subsystem has been written so that
> > when you disable an edge-triggered interrupt, and the edge happens while
> > the interrupt is disabled, we will re-play the interrupt at enable time.
> > Exactly so that drivers can have an easier time and don't have to
> > normally worry about whether something is edge or level-triggered.
>
> And found this note in Documentation/DocBook/genericirq.tmpl:
>
> > This prevents losing edge interrupts on hardware which does
> > not store an edge interrupt event while the interrupt is disabled at
> > the hardware level.
>
> So I think it is very clear that the chip driver should not discard
> edges that happened while the interrupt was disabled.
Correct.
--
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up. Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".
next prev parent reply other threads:[~2014-01-24 10:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-23 22:38 [PATCH 0/3] irqchip: orion: bridge irq fixes for v3.14-rc1 Sebastian Hesselbarth
2014-01-23 22:38 ` [PATCH 1/3] irqchip: orion: clear bridge cause register on init Sebastian Hesselbarth
2014-01-24 21:41 ` Ezequiel Garcia
2014-01-23 22:38 ` [PATCH 2/3] irqchip: orion: use handle_edge_irq on bridge irqs Sebastian Hesselbarth
2014-01-23 22:38 ` [PATCH 3/3] irqchip: orion: clear stale interrupts in irq_enable Sebastian Hesselbarth
2014-01-23 22:52 ` Jason Gunthorpe
2014-01-23 23:05 ` Sebastian Hesselbarth
2014-01-24 10:55 ` Russell King - ARM Linux [this message]
2014-01-23 23:10 ` [PATCH v2 3/3] irqchip: orion: clear stale interrupts in irq_startup Sebastian Hesselbarth
2014-02-05 4:54 ` [PATCH 0/3] irqchip: orion: bridge irq fixes for v3.14-rc1 Jason Cooper
2014-02-06 17:10 ` Ezequiel Garcia
2014-02-06 18:05 ` Jason Cooper
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=20140124105539.GD15937@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=andrew@lunn.ch \
--cc=ezequiel.garcia@free-electrons.com \
--cc=gregory.clement@free-electrons.com \
--cc=jason@lakedaemon.net \
--cc=jgunthorpe@obsidianresearch.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sebastian.hesselbarth@gmail.com \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®