From: Lee Jones <lee.jones@linaro.org>
To: anish kumar <anish198519851985@gmail.com>
Cc: manty kuma <mantykuma@gmail.com>,
kernelnewbies@kernelnewbies.org,
Linus Walleij <linus.walleij@stericsson.com>,
linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Rob Herring <rob.herring@calxeda.com>,
Paul Mundt <lethal@linux-sh.org>,
Russell King <linux@arm.linux.org.uk>,
Linus Walleij <linus.walleij@linaro.org>,
Anmar Oueja <anmar.oueja@linaro.org>
Subject: Re: Interrupt handling - Linux
Date: Thu, 29 Nov 2012 11:18:46 +0000 [thread overview]
Message-ID: <20121129111846.GG2013@gmail.com> (raw)
In-Reply-To: <1354184144.1600.76.camel@anish-Inspiron-N5050>
On Thu, 29 Nov 2012, anish kumar wrote:
> On Wed, 2012-11-28 at 20:10 +0530, manty kuma wrote:
> > In linux interrupt programming, we do request_irq(...) in this
> > function, the first argument is irq number. If i am not wrong, this is
> > the interrupt line that we are requesting from kernel. For one
> Right.
> > particular hardware, is this IRQ line fixed or can it register on any
> > line based on the availability? The concept is not clear. Kindly
> In linux there are two concepts related to interrupt which is never
> clearly mentioned anywhere(at least not that I know of) and that is why
> let me clarify.
Documentation/IRQ-domain.txt
> 1. Hardware interrupt number.Given by your irq controller or the
> hardware which is capable of generating the interrupts.
> 2. Software interrupt number assigned by linux interrupt handling core.
>
> So the first question which arises in mind is: why does linux generates
> the software interrupt number?Won't hardware interrupt number be enough
> to keep everyone happy?
>
> Simple reason is just for book keeping as the software interrupt numbers
> generated would be linear as we are in control of what numbers to
> allocate and if we start using the numbers generated by irq controller
> which can generate random numbers then searching and indexing would
> require expensive operations as compared to working in linear
> domain(experts can add more here if I am not to the point).
>
> However if your irq controller is capable of choosing the interrupt
> numbers then linux irq number will be same as hardware interrupt number.
>
> So let's come back to the question.So for a particular hardware the
> hardware interrupt line would be always fixed as well as the software
> interrupt numbers generated by the linux irq core.
>
> > explain. Also, when i do interrupt programming for AVR or ARM, all
> > the peripherals are having fixed IRQ numbers. and they are having
> > handlers. There is no concept of interrupt lines as such. So my
> > second question is how are IRQ lines and IRQ numbers related?
> IRQ lines are connected to irq controller and you should have a look at
> the driver of your irq controller as to how does it assign the hardware
> irq numbers(probably by reading some registers).All the peripherals are
> connected to the irq controller such as keyboard and mouse and they have
> fixed irq lines.Once a signal is asserted the irq controller raises an
> interrupt to arm core and arm core in turn raises a hardware
> interrupt.This hardware interrupt will call into linux irq handling
> code.Which interrupt handler to be called is already decided by the
> individual drivers, remember they have called request_irq with an
> interrupt number.
> This interrupt number would be a software interrupt number as explained
> before and this number to hardware interrupt number association is done
> by the interrupt controller or the chip driver which is capable of
> taking(handling) one interrupt and calling individual interrupt handlers
> after reading the corresponding registers(read handle_nested_irq).
> This conversion of hardware interrupt number to software interrupt
> number is done in /kernel/irq/irqdomain.c file.
>
> PS:I may be wrong but this description is from what I have read in the
> code.Please do point out any mistakes.
> >
> >
> > Thanks,
> > Sandeep
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies@kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
prev parent reply other threads:[~2012-11-29 11:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAB6A5-AN7boq57w7z+x6bhO3mYsbHzyD6cAkq1BXN5a+B=2XyQ@mail.gmail.com>
2012-11-29 10:15 ` Interrupt handling - Linux anish kumar
2012-11-29 11:18 ` Lee Jones [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121129111846.GG2013@gmail.com \
--to=lee.jones@linaro.org \
--cc=anish198519851985@gmail.com \
--cc=anmar.oueja@linaro.org \
--cc=kernelnewbies@kernelnewbies.org \
--cc=lethal@linux-sh.org \
--cc=linus.walleij@linaro.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mantykuma@gmail.com \
--cc=rob.herring@calxeda.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox