mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* How to atomically disable shared device interrupt?
@ 2009-02-04 17:30 Andrey Borzenkov
  0 siblings, 0 replies; only message in thread
From: Andrey Borzenkov @ 2009-02-04 17:30 UTC (permalink / raw)
  To: Linux Kernel Development

[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]

May be I miss something obvious, but I do not see how is it possible to 
disable interrupt while also avoiding either "stealing" someone else's 
interrupt or getting "IRQ: nobody cared" occasionally.

So consider device that has status register that indicates events of 
interest that happened in device. Those events may also generate 
interrupt if interrupt generation is enabled; but they also are posted 
even if interrupt generation is disabled.

So to check whether interrupt handler should handle (shared) interrupt 
it a) checks that interrupts are currently enabled and b) that device 
indicates pending events.

No consider what happens when interrupts are disabled on device.

CPU1                       CPU2
IRQ posted
                        disable device interrupts
handler checks IRQ enabled
handler sees IRQ disabled
handler ignores interrupt

Actually the same race happens during enabling of interrupts

CPU1                       CPU2
IRQ enabled
                      other device posts IRQ
handler checks
  IRQ enabled
  events pending
  start processing

but IRQ was posted by some other device in the first place.

Any idea?

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-04 17:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-04 17:30 How to atomically disable shared device interrupt? Andrey Borzenkov

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®