How kernel handle interrupts
Woody Wu
narkewoody at gmail.com
Fri Dec 21 04:34:33 EST 2012
在 2012-12-21 AM2:05,"anish singh" <anish198519851985 at gmail.com>写道:
>
>
> On Dec 20, 2012 6:30 AM, "Woody Wu" <narkewoody at gmail.com> wrote:
> >
> > Hi, List
> >
> > Where is the Kernel code that handles external interrupts? I want to
> > have a look at it but haven't found out where it is.
> >
> > Actually, I have some basic questions about interrupt handling in Linux.
> > 1. After Kernel's ISR received an interrupt, I believe it will invoke a
> > handler defined in a device driver if any. But it should be the
> > device driver's responsibility or kernel ISR's responsibility to
> > clear (or acknowledge) the interrupt?
> If the interrupt in question is currently being handled then in
> the case of edge triggered interrupt we just mask the interrupt,set it
pending and bail out.Once the interrupt handler completes then we check for
pending interrupt and handle it.In level triggered we don't do that.
> Kerenel ISR -this is mixture of core kernel interrupt handling code +
your device driver interrupt handler(if this is chip driver which is
supposed to get one interrupt and is reponsible for calling other interrupt
handlers based on the chip register status then you do explicit masking
unmasking yourself).
> If you device driver is a interrupt controller driver then you register
your driver with kernel interrupt handling code and need to write some
callbacks such as .mask,.unmask and so on.This callbacks are called at
appropiate places whenever the interrupt is raised.This interrupt is then
passed to drivers who has requested for this interrupt by calling
request_irq.
Sorry not fully understand . My device is an Ethernet controller. It needs
to response TX and RX interrupts triggered by the device itself. In this
case , my driver is a chip driver or interrupt controller driver in your
terms?
If my driver needs to do the mask and unmask job, what's the kernel API I
should call?
And , I don't understand why there exists differences between level and
edge triggered interrupts in terms of kernel handling.
I know my questions might be basic , so would please tell me what's the
kernel code for ARM architecture doing these complex jobs as you explained?
Thanks in advance !
>
> >
> > 2. My device, an AX88796B network controller, asserting the interrupt
> > line in a level-triggered manner. Now I met problem with the device
that
> > might caused by the CPU interrupt mode is not set as level-triggered
by
> > edge trigger. My CPU is Samsung S3C2410, an ARM920T powered one.
Does
> > anyone know usually where and how should I do this kind of setting?
> Just pass the parameter "level triggered" in request_irq in your device
driver.
>
> >
> >
> > Thanks in advance.
> >
> > --
> > woody
> > I can't go back to yesterday - because I was a different person then.
> >
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies at kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20121221/9c0e469a/attachment.html
More information about the Kernelnewbies
mailing list