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

Re: Device drivers for LINUX (useless message as well)



Hi!


> There certainly is! It stems from the hardware architecture of your system.
> The 'Edge triggered' interrupt is an interrupt which is triggered only when
> there is a change in the state of the interrupt line in a definite
> direction. The 'Level triggered' interrupt is one which will be invoked when
> a certain signal is maintained for a minimum period of time. Interrupt
> controllers R made to recognize either.

Not precise. Level triggered interrupt are interrupts which are 
invoked whenever the interrupt signal is set (low or high), meaning 
whenever the interrupt is ended if the signal is still set another 
interrupt will be issued. The fact that they need to be maintained 
for a "minimum time" is true because of propagation delays and the 
like, and while discrete interrupt controllers have long since been 
dropped in favor of modules in the VLSI chipsets now used, the 
particular module used in PCs (which mimic the 8259A) can be 
configured for either edge or level trigger.
In PCs it is usually set to edge trigger.
 
> Please note that both edge and level interrupts can be shared among devices.
> Edge triggered interrupts are more inclined to sharing, though. The reason
> is that a level triggered interrupt usually will not release the interrupt
> line until the signal has been acknowledged by the (usually) interrupt
> controller.

This is not entirely correct, it is simpler to *implement* sharing in 
level triggered interrupts.
For level triggered interrupts the routine/driver would check whether 
it is supposed to serve the device requesting the interupt. If this is 
the case it would tell the device to drop the interrupt. In any 
case it would send an EOI to the interrupt controller before 
terminating.
If the device had not been served then the interrupt controller would 
automatically issue another interrupt and all the kernel has to do is 
rotate through the drivers handling the interrupt. 
For edge triggered signals things become more complicated requiring
some protocol to indicate whether the interrupt has been handled or 
not, and things become even more complicated because, as you said, the 
interrupt signal is free and can be used by another device to request 
a further interrupt.
This is the reason that interrupt sharing does not work too well on 
the PC.

> To sum up, the choice between Edge to Level triggered interrupts is made for
> U by the system architecture, and does not depend on the whims of the device
> driver.

Indeed. In any case interrupt sharing requires added hardware on the 
sharing device, as is the case with COM ports (in which all the 
problems of edge triggered interrupts are handled by having the one 
device driver handle all the ports). 

> Unfortunately, I'm not familiar with the intricacies of the Linux device
> driver system, thus unable to help U there.

Same here, but I'm willing to bet any interrupt sharing is done 
at the driver level and the kernel has nothing to do with it.

Eli Algranti <OR17367@elbit.co.il>

... 1024 buckets of bits on a wall 1024 buckets of bits