Michael Hunold wrote:
It might make a difference when clearing the irq bit signals the hardware that it can continue doing something or start some transaction before we are able to process the irq trown by this transaction.Hello Emard,My limited understanding of interrupts idea is this: 1. interrupt arrives, calls the handler routine 2. looking at what caused the interrupt, a local copy of dvb data related to furter interrupt processing is done and tasklet process is scheduled to process the interrupt 3. interrupt ISR register is cleared so new interrupts can arrive. As looking in the saa7146_core, it goes 1-3-2 and I think it should go 1-2-3.
I does not matter in this case. The irq handler is called with the interrupts for the saa7146 disabled (in simple words: disabled by the Linux irq subsystem), it cannot be interrupted with an interrupt from the saa7146, unless you exit the interrupt handler.
So it does not matter if you do 1-3-2 or 1-2-3.
We had to do this to keep Interrupt latencies low, in early versions of the driver the software demultiplexer was called directly in the interrupt handler.Still I don't know at the point 2 in the code is LOCAL COPY of all dvb data done before scheduling tasklets. Because you know, when next interrupt arrives, it should not overwrite data the currently-being-processed interrupt event...
A matter, however, is, that the av7110 driver is using tasklets for actually serving what has cause the interrupt. Tasklets are called *after* the interrupt handler has exited, in interrupt-context, but with interrupts enabled by both the Linux irq subsystem and the irq handler.
Note: you cannot defer step 3 to the tasklet. If you don't clear the isr in the interrupt handler, it will be called again immediately thus causing a system lockup. (This is the sort of error you only make once... ;-)You would have to add a stack for the ISR value to the av7110 struct. and check at end of the tasklet if there is anything else to do when you expect this scenario. Watch out for race conditions.
What can happen now is, of course, that your takslet which is trying to procsess some data, is interrupted by the same interrupt again. (ie. interupts happen faster than you can actually handle)
Tasklets cannot be stacked, ie. even if the irq handler schedules the tasklet function to be run again, it won't be called again.
So you need to handle all these cases appropriately.
I would rather delay clearing the ISR register in order to avoid new interrupts before we handled the old one.
Holger
--
Info:
To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe linux-dvb" as subject.
