2002-09-24 21:10:02

by Mohamed Ghouse , Gurgaon

[permalink] [raw]
Subject: Interrupt Sharing

Hello All

Can any one throw some light on how the Interrupt sharing is acheived by
the Linux Operating System for a PCI Compliant device?

Let me Re-Phrase the Question
The PCI Interrupts are shareable. How does the Operating System(Linux)
implement this?

TIA
-MG


2002-09-24 21:19:57

by Robert Love

[permalink] [raw]
Subject: Re: Interrupt Sharing

On Tue, 2002-09-24 at 17:19, Mohamed Ghouse , Gurgaon wrote:

> Let me Re-Phrase the Question
> The PCI Interrupts are shareable. How does the Operating System(Linux)
> implement this?

It does not have to do anything special, actually. If interrupt n comes
in, then each handler registered on interrupt n is run.

The incorrect handlers should check for work to do, see none, and
return. The correct one will actually run.

Robert Love

2002-09-24 21:31:24

by Mohamed Ghouse , Gurgaon

[permalink] [raw]
Subject: RE: Interrupt Sharing

But what if two PCI Devices are sharing the same interrupt line?
Then how does the handler handle this?
Can you please explain this handling by the Kernel?

-MG

> -----Original Message-----
> From: Robert Love [mailto:[email protected]]
> Sent: Wednesday, September 25, 2002 2:55 AM
> To: Mohamed "Ghouse , Gurgaon
> Cc: Linux-Kernel (E-mail)
> Subject: Re: Interrupt Sharing
>
>
> On Tue, 2002-09-24 at 17:19, Mohamed Ghouse , Gurgaon wrote:
>
> > Let me Re-Phrase the Question
> > The PCI Interrupts are shareable. How does the Operating
> System(Linux)
> > implement this?
>
> It does not have to do anything special, actually. If
> interrupt n comes
> in, then each handler registered on interrupt n is run.
>
> The incorrect handlers should check for work to do, see none, and
> return. The correct one will actually run.
>
> Robert Love
>

2002-09-25 05:05:06

by Zwane Mwaikambo

[permalink] [raw]
Subject: RE: Interrupt Sharing

On Wed, 25 Sep 2002, Mohamed Ghouse , Gurgaon wrote:

> But what if two PCI Devices are sharing the same interrupt line?
> Then how does the handler handle this?
> Can you please explain this handling by the Kernel?

have a look at arch/i386/kernel/irq.c:request_irq then go down to do_IRQ
-> handle_IRQ_event. if you want the guts before that, check out
arch/i386/kernel/entry.S around common_interrupt.

Zwane


--
function.linuxpower.ca

2002-09-25 08:32:32

by Martin Mares

[permalink] [raw]
Subject: Re: Interrupt Sharing

Hello!

> But what if two PCI Devices are sharing the same interrupt line?
> Then how does the handler handle this?
> Can you please explain this handling by the Kernel?

All drivers register their interrupt handlers by calling request_irq().
When a shared interrupt arrives, all handlers for this interrupt are
run and each of them polls the status register of the device it handles
to see whether this device needs servicing.

Have a nice fortnight
--
Martin `MJ' Mares <[email protected]> http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
Why is it called "common sense" when nobody seems to have any?