From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Stephen Hemminger <shemminger@osdl.org>,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: better leve triggered IRQ management needed
Date: Mon, 24 Apr 2006 20:15:58 +0100 [thread overview]
Message-ID: <20060424191558.GB16464@flint.arm.linux.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.64.0604241156340.3701@g5.osdl.org>
On Mon, Apr 24, 2006 at 12:02:47PM -0700, Linus Torvalds wrote:
> On Mon, 24 Apr 2006, Stephen Hemminger wrote:
> > We should fail request_irq() if the SA_SHIRQ but the irq is edge-triggered.
>
> That would be HORRIBLE.
>
> Edge-triggered works perfectly fine for SA_SHIRQ, as long as there is just
> one user and the driver is properly written. Making request_irq() fail
> would break existing and working setups.
Sorry, untrue. If you take a serial port and a network card on the same
edge triggered interrupt line, take the following sequence of events:
1. serial port receives characters, asserts interrupt.
2. interrupt handlers get called, serial starts reading characters from
the port. Interrupt does not change state because there's still
characters in the FIFO to be read.
3. meanwhile, the network interface receives a packet and asserts it's
interrupt. Interrupt does not change state since it's already asserted.
4. serial interrupt handler continues to service serial ports until it is
damned sure all serial ports have released the interrupt line, and
returns. Interrupt does not change state because the network device
is holding it asserted.
5. network interrupt handler gets invoked next (it's next in the chain)
but hasn't acknowledged the interrupt. Hence, the interrupt line has
remained asserted since step 1.
6. serial port receives another character, asserting it's interrupt output.
7. network interrupt handler services network device. Network device is
no longer holding the interrupt line in the asserted state. But the
serial device is, so still no change in interrupt line state since
step 1.
8. all handlers complete, kernel returns to foreground task.
9. No further serial or network interrupts because there's _no_ edge to
trigger the interrupt. Your serial and network are dead.
If you allow shared interrupts, no matter how hard you try in a driver,
you can NOT get around this problem. It has to be handled at a higher
level.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
next prev parent reply other threads:[~2006-04-24 19:16 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-24 18:41 Stephen Hemminger
2006-04-24 18:59 ` linux-os (Dick Johnson)
2006-04-24 19:02 ` Linus Torvalds
2006-04-24 19:08 ` Linus Torvalds
2006-04-24 19:53 ` Arjan van de Ven
2006-04-24 20:16 ` Alan Cox
2006-04-24 20:43 ` Arjan van de Ven
2006-04-24 21:07 ` Linus Torvalds
2006-04-24 21:20 ` Alan Cox
2006-04-24 22:26 ` Linus Torvalds
2006-04-24 21:22 ` [RFC 1/2] irq: record edge-level setting Stephen Hemminger
2006-04-24 21:49 ` Alan Cox
2006-04-24 21:41 ` Stephen Hemminger
2006-04-24 22:34 ` Linus Torvalds
2006-04-24 22:58 ` Stephen Hemminger
[not found] ` <20060424141926.3872f921@localhost.localdomain>
2006-04-24 21:22 ` [RFC 2/2] warn on shared edge-triggered irq Stephen Hemminger
2006-04-25 15:23 ` better leve triggered IRQ management needed Michael Buesch
2006-04-24 19:15 ` Russell King [this message]
2006-04-24 20:18 ` Linus Torvalds
2006-04-24 19:25 ` Stephen Hemminger
2006-04-24 19:35 ` linux-os (Dick Johnson)
2006-04-24 20:19 ` Linus Torvalds
2006-04-24 20:50 ` linux-os (Dick Johnson)
2006-04-24 21:09 ` Linus Torvalds
2006-04-29 21:25 ` Alan Cox
2006-04-29 21:58 ` Linus Torvalds
2006-04-30 4:48 ` Neil Brown
2006-04-30 5:19 ` Linus Torvalds
2006-04-30 6:13 ` Neil Brown
2006-04-30 6:59 ` Linus Torvalds
2006-05-02 5:10 ` Neil Brown
2006-05-02 15:05 ` Linus Torvalds
2006-04-30 7:36 ` Arjan van de Ven
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=20060424191558.GB16464@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shemminger@osdl.org \
--cc=torvalds@osdl.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
Powered by JetHome