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.

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... ;-)

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.

Anyway, this is the patch, Budget and DVB-S are running together,
with high traffic on budget and alevt and xawtv running on dvb-s.
Budget has IRQ alone, DVB-S shares irq with network card and usb.

The Interrupt stability patch (check will it work for you):

diff -rup src/DVB/driver/av7110/saa7146_core.c DVB/driver/av7110/saa7146_core.c
--- src/DVB/driver/av7110/saa7146_core.c Tue Nov 26 22:00:04 2002
+++ DVB/driver/av7110/saa7146_core.c Wed Jan 1 18:38:58 2003
@@ -418,12 +418,14 @@ static void saa7146_irq(int irq, void *d
/* read out the primary status register */
isr = saa7146_read(saa->mem, ISR);
- /* clear all IRQs */
- saa7146_write(saa->mem, ISR, isr);

/* is anything to do? */
if ( 0 == isr )
+ {
+ /* clear all IRQs */
+ saa7146_write(saa->mem, ISR, isr);
return;
+ }
dprintk("%s: irq-call: isr:0x%08x\n",saa->name,isr);

@@ -434,6 +436,8 @@ static void saa7146_irq(int irq, void *d
saa7146_ext[i]->irq_handler(saa, isr, saa->data[i]);
//saa7146_write(saa->mem, ISR, saa7146_ext[i]->handles_irqs);
}
+ /* clear all IRQs */
+ saa7146_write(saa->mem, ISR, isr);

//printk(KERN_ERR "%s: unhandled interrupt: 0x%08x\n", saa->name, isr);
Your patch shouldn't have any effect on the driver's behaviour.

CU
Michael.



--
Info:
To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe linux-dvb" as subject.

Reply via email to