lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 25 Dec 2012 00:07:54 +0800
From:	Woody Wu <narkewoody@...il.com>
To:	anish kumar <anish198519851985@...il.com>
Cc:	kernelnewbies@...nelnewbies.org, linux-kernel@...r.kernel.org
Subject: Re: How kernel handle interrupts[AX88796B network controller]

On Mon, Dec 24, 2012 at 10:10:17PM +0800, Woody Wu wrote:
> On Fri, Dec 21, 2012 at 01:33:03PM -0800, anish kumar wrote:
> > On Fri, 2012-12-21 at 23:34 +0800, Woody Wu wrote:
> > > On Thu, Dec 20, 2012 at 10:05:05AM -0800, anish singh wrote:
> > > > On Dec 20, 2012 6:30 AM, "Woody Wu" <narkewoody@...il.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.
> > > > >
> > > > > 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.
> > > 
> > > Hi Sign,
> > > 
> > > I searched the interrupt.h for the all the defined flags that I can pass
> > > to the request_irq, but there is no a flag looks like "level triggered".
> > > Would you tell me what you mean the parameter "level triggered"?
> > irq_set_irq_type(info->irq, IRQ_TYPE_LEVEL_LOW)
> > 
> > include/linux/irq.h
> > IRQ_TYPE_LEVEL_HIGH          - high level triggered
> > IRQ_TYPE_LEVEL_LOW           - low level triggered
> 
> Thanks. You saved my ass.
> 
> Be curious, I found the api changes from 2.6 to 3.7.  In 2.6, there are
> pair of funtions, set_irq_type and set_irq_handle (there is no
> irq_set_irq_type in 2.6).  Problem is, I cannot find something like
> irq_set_irq_handle in 3.7.  Does that mean, in 3.7, when
> irq_set_irq_type is changed, the associated flow handler is also
> changed?  In my case, the interrupt was originally assgined with a edge
> flow handler and set type as edge irq. After I, by invoking
> irq_set_irq_type, change it to level irq, I think the flow handler
> should also be changed to a level handle.  Is that happened
> automatically behind?  I search through the code, but did not find where
> is it.

Make it simple, is it necessary to also change the irq flow handler
after changed a irq type (from edge to level)? Is yes, what's the public
api that let user change flow handler for an irq?

Thanks in advance.

> 
> 
> > > 
> > > Thanks.
> > > 
> > > > >
> > > > >
> > > > > Thanks in advance.
> > > > >
> > > > > --
> > > > > woody
> > > > > I can't go back to yesterday - because I was a different person then.
> > > > >
> > > > > _______________________________________________
> > > > > Kernelnewbies mailing list
> > > > > Kernelnewbies@...nelnewbies.org
> > > > > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> > > 
> > 
> 
> -- 
> woody
> I can't go back to yesterday - because I was a different person then.

-- 
woody
I can't go back to yesterday - because I was a different person then.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists