Re: how the interrupt handler(ISR) knows the source of interrupt ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



El Thu, Mar 29, 2007 at 03:04:53PM +0530 Mansha Linux ha dit:

>    On 3/29/07, Rajat Jain <[1]rajat.noida.india@xxxxxxxxx> wrote:
> 
>      On 3/29/07, Mansha Linux <[2]mansha.linux@xxxxxxxxx> wrote:
>      >
>      >
>      > On 3/29/07, Rajat Jain <[3]rajat.noida.india@xxxxxxxxx> wrote:
>      > > On 3/29/07, Mansha Linux < [4]mansha.linux@xxxxxxxxx> wrote:
>      > > > hi all,
>      > > >
>      > > > When the external hardware device  raise the interrupt the
>      corresponding
>      > ISR
>      > > > will be executed.
>      > > > but how this ISR will come to know about the source of interrupt.
>      i mean
>      > the
>      > > > ISR will identify with respect to device id ..but when this device
>      id is
>      > > > passed to the ISR  and as well as IRQ number?
>      > >
>      > > Hi Mansha,
>      > >
>      > > The ISR itself has the responsibility of detecting whether the
>      device
>      > > it serves, has raised the interrupt or not. Now how it confirms this
>      > > from the device is quite device specific and may vary. But most of
>      the
>      > > devices have a status register kind of thing that you can test to
>      see
>      > > if it generated the interrupt.
>      > >
>      > > Also, getting the device ID of the device is also the resposibility
>      of
>      > > the ISR. But the most common approach is that when registering the
>      > > ISR, you also pass the device ID to request_irq(). So the ISR will
>      > > also get the device ID as parameter when it is called.
>      > >
>      > > Thanks,
>      > >
>      > > Rajat
>      > >
>      >
>      >
>      > Thanks for ur reply..
>      >
>      > >
>      > > >
>      > > > > The ISR itself has the responsibility of detecting whether the
>      device
>      > > > > it serves, has raised the interrupt or not. Now how it confirms
>      this
>      > > > > from the device is quite device specific and may vary. But most
>      of the
>      > > > > devices have a status register kind of thing that you can test
>      to see
>      > > > > if it generated the interrupt.
>      > > > >
>      > > >
>      > > > Also, getting the device ID of the device is also the
>      resposibility of
>      > > > the ISR. But the most common approach is that when registering the
>      > > > ISR, you also pass the device ID to request_irq(). So the ISR will
>      > > > also get the device ID as parameter when it is called.
>      > > >
>      > >
>      > >
>      >
>      >
>      > -> ya, while registering the IRQ we will specify the divice id. but i
>      wanted
>      > to know how the ISR will confirms the device id because we are not
>      passing
>      > any divice id while interrupt is issued.
> 
>      Here is how it works:
> 
>      1) The driver registers ISR for each device it services, also telling
>      the kernel the corresponding device ID. This is done by calling
>      request_irq().
> 
>      2) When the IRQ occurs, the kernel invokes EACH and every ISR hooked
>      onto that IRQ (Not just the ISR that actually services the device).
> 
>      3) Each ISR receives its original device ID as parameter, it
>      determines whether the corresponding device is the one that generated
>      the IRQ.
> 
>      HTH,
> 
>      Rajat
> 
>    ok. but when the ISR receives the device id and who will pass this device
>    id to the ISR ??

handle_IRQ_event() calls all ISRs of the IRQ passing the device id
with which the ISR was registered, and not necessarily the id of the
device that raised the interrupt

-- 
Matthias Kaehlcke
Linux Application Developer
Barcelona

             If liberty means anything at all, it means the
           right to tell people what they do not want to hear
                            (George Orwell)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux