linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jgunthorpe@obsidianresearch.com (Jason Gunthorpe)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] irqchip: orion: clear stale interrupts in irq_enable
Date: Thu, 23 Jan 2014 15:52:08 -0700	[thread overview]
Message-ID: <20140123225208.GA24778@obsidianresearch.com> (raw)
In-Reply-To: <1390516686-2224-4-git-send-email-sebastian.hesselbarth@gmail.com>

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?

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.

Regards,
Jason

  reply	other threads:[~2014-01-23 22:52 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 [this message]
2014-01-23 23:05     ` Sebastian Hesselbarth
2014-01-24 10:55     ` Russell King - ARM Linux
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=20140123225208.GA24778@obsidianresearch.com \
    --to=jgunthorpe@obsidianresearch.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).