linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Hancock <hancockr@shaw.ca>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Lee Revell <rlrevell@joe-job.com>
Subject: Re: [PATCH 2.6.16] Shared interrupts sometimes lost
Date: Sun, 09 Apr 2006 12:12:54 -0600	[thread overview]
Message-ID: <44394EA6.3000309@shaw.ca> (raw)
In-Reply-To: <5ZoDL-3rE-7@gated-at.bofh.it>

Lee Revell wrote:
> On Sat, 2006-04-08 at 14:10 +1000, Neil Brown wrote:
>>  To explain what I think is happening, let me start with a very simple
>>  case.  A number of PCI devices (this one included) have a number of
>>  events which can trigger an interrupt.  The events which are current
>>  are presented as bits in a register, and are ORed together (and
>>  possibly masked by another register) to make the IRQ line.
>>  When 1's are written to any bits in this register, it acknowledges
>>  the event and clears the bit.
>>  A typical code fragment is 
>>    events = read_register(INTERRUPTS);
>>    write_register(INTERRUPTS, events);
>>    ... handle each 1 bits in events ....
>>
> 
> Isn't a more typical IRQ handler:
> 
> while (events = read_register(INTERRUPTS) != 0) {
> 	...handle each bit in events and ACK it...
> }

That would be less efficient, it would read the register twice or more 
if any events have been set, and reading device registers can be 
expensive. In the unlikely event the event was set while inside the ISR 
the interrupt should be asserted again so there is no need to do this.

-- 
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/


  parent reply	other threads:[~2006-04-09 18:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5Zd5E-3vi-7@gated-at.bofh.it>
2006-04-08 14:10 ` [PATCH 2.6.16] Shared interrupts sometimes lost Robert Hancock
2006-04-09  9:48   ` How to correct ELCR? - was " Neil Brown
2006-04-09 15:48     ` Francois Romieu
2006-04-09 22:28       ` Neil Brown
2006-04-11 17:07     ` Pavel Machek
2006-04-12  4:01       ` Neil Brown
     [not found] ` <5ZoDL-3rE-7@gated-at.bofh.it>
2006-04-09 18:12   ` Robert Hancock [this message]
2006-04-09 18:24     ` Lee Revell
2006-04-08  4:10 Neil Brown
2006-04-08 16:31 ` Lee Revell
2006-04-09  6:02   ` Neil Brown
2006-04-11 17:07 ` Pavel Machek
2006-04-12  0:01   ` Neil Brown
2006-04-13  5:41     ` Pavel Machek

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=44394EA6.3000309@shaw.ca \
    --to=hancockr@shaw.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rlrevell@joe-job.com \
    /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).