Re: Doubt on Interrupt sharing

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

 



Rajendra Stalekar wrote:


Rajendra :- How can that be done? Is it not a physical interrupt line(wire),
how can that line go to multiple devices.

That is the job of interrupt controller in the hardware- it multiplexes the interrupt sources and presents them on the single interrupt number IRQ number shown in /proc/interrupts. The way it is implemented in the hardware differs for each architecture. When dealing with the shared interrupts, the interrupt handler for each device driver needs to know what hardware device caused the interrupt by means of dev_id argument which must be unique for every device that claims the same interrupt line (IRQ number) - hence every shared interrupt handler checks if the interrupt was caused by the device it supports and handles the interrupt only if it is from its device - otherwise the interrupt handler should return IRQ_NONE and possibly let another (correct) device driver handle the interrupt and return IRQ_HANDLED.


I can understand during driver initialization it's not a good idea to
install the handler because we don't know whether we are going to use the
device.

But if we install the handler when the device is opened how can we share
the
interrupt line because it is now dedicated for it.

If I understand the question correctly - this is done when registering the interrupt handler. If shared interrupt line is used, every interrupt handler that claims the same IRQ number must use SA_SHIRQ in the flags argument. That being said it doesn't really matter which driver claims the shared line first as long as all of them are using SA_SHIRQ in their flags.

Correct me if I'm wrong...

best regards,
hinko
--
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: hinko.kocevar@xxxxxxxxxxxx
Http: www.cetrtapot.si


--
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