Mailing List archive

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

[linux-dvb] Re: DVB-S interrupt nesting



> Is anybody of the card patchers willing to implement + test this and 
> then send us patches for both DVB/ and dvb-kernel/ trees?

More discussion leads to more imporvement. I think above discussed
approach may be good and performance-efficient. But first some obvious 
inconsistencies regarding IER and ISR have to be cleared. For me 
there is too much 'gray spots' in the saa7146_core.c and av7110.c

I'm using convergence sources because I didn't know for anything
else and still I don't don't know which sources for which types of 
cards and applications is more preferrable. I have looked at latest 
codes of Michael and Metzler bros. All of them have basically the 
same IER/ISR logic.

Previous patch has been tested by myself for whole day of heavy 
load and everything worked out smooth. (except zombie for 
fast reopening of the frontend while xawtv is running but 
that's old yet unfixed issue regarding API implementation).

However during discussion with Michael he mentioned some tasklets 
inside of av7110.c, so I took a look at them and immediately patched 
things that looked most terrible at the first glance.

Here's the result. I already achieved stability with the previous
patch for my machine, but this patch should lead to more stability 
for people with various hardware, slower CPU and/or loaded PCI bus.


diff -pur /home/loader/src/DVB/driver/av7110/av7110.c DVB/driver/av7110/av7110.c
--- /home/loader/src/DVB/driver/av7110/av7110.c	Mon Dec 30 15:48:57 2002
+++ DVB/driver/av7110/av7110.c	Thu Jan  2 22:38:23 2003
@@ -1331,6 +1331,7 @@ void gpioirq (unsigned long data)
                 }                  /* yes, fall through */
         case DATA_TS_RECORD:
         case DATA_PES_RECORD:
+                wait_for_debi_done(av7110);
                 saa7146_write(av7110->saa_mem, IER, 
                               saa7146_read(av7110->saa_mem, IER) | MASK_19);
                 irdebi(av7110, DEBISWAB, DPRAM_BASE+rxbuf, 0, len);
@@ -1342,6 +1343,7 @@ void gpioirq (unsigned long data)
                         iwdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2);
                         break;
                 }
+                wait_for_debi_done(av7110);
                 saa7146_write(av7110->saa_mem, IER, 
                               saa7146_read(av7110->saa_mem, IER) | MASK_19);
                 irdebi(av7110, DEBISWAB, Reserved, 0, len);
diff -pur /home/loader/src/DVB/driver/av7110/saa7146_core.c DVB/driver/av7110/saa7146_core.c
--- /home/loader/src/DVB/driver/av7110/saa7146_core.c	Tue Nov 26 22:00:04 2002
+++ DVB/driver/av7110/saa7146_core.c	Thu Jan  2 23:08:03 2003
@@ -418,12 +418,23 @@ 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 )
+		{
+			/* acknowledge all IRQs */
+			saa7146_write(saa->mem, ISR, isr);
 			return;
+		}
+
+                /* if DEBI interrupt has arrived, immediately
+                ** disable further requests of DEBI. 
+                ** It will be re-enabled at the 
+                ** end of gpioirq tasklet
+                */
+                if(isr & MASK_19)
+                        saa7146_write(saa->mem, IER,
+                          saa7146_read(saa->mem, IER) & ~MASK_19);
 
 		dprintk("%s: irq-call: isr:0x%08x\n",saa->name,isr);
 		
@@ -434,6 +445,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);
 			}
+		/* acknowledge all IRQs */
+		saa7146_write(saa->mem, ISR, isr);
 		
 		//printk(KERN_ERR "%s: unhandled interrupt: 0x%08x\n", saa->name, isr);
 		


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index