Assigning statically bttv irqs

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

 



Hi all,

I want to assign bttv irqs in order to don't share irqs between bttv cards.
So, can i try to assign "statically", at least for some test, irqs in bttv 
code?
Could I lead to some problem doing that?

My idea is to assign statically as best as possibile irq for all bttv chip, 
inside bttv_probe() and see is it improve in performance or quality.

I did a simple patch (in attachment) that implement it. 
Only this doen's work, as I see continuosly 

Dec 19 16:58:46 localhost kernel: bttv0: timeout: drop=0 irq=0/0, 
risc=0176f03c, irq.n=21bits: VSYNC HSYNC RISCI
Dec 19 16:58:46 localhost kernel: bttv0: reset, reinitialize
Dec 19 16:58:46 localhost kernel: bttv0: PLL: 28636363 => 35468950 . ok

Instead interrupts are registered correctly:
~# cat /proc/interrupts 
           CPU0       CPU1       
  0:        255          0   IO-APIC-edge      timer
  1:         10          0   IO-APIC-edge      i8042
  8:          0          0   IO-APIC-edge      bttv0
  9:          0          0   IO-APIC-fasteoi   acpi, bttv1
 10:          0          0   IO-APIC-edge      bttv2
 11:          0          0   IO-APIC-edge      bttv3
 12:          0          0   IO-APIC-edge      bttv4
 13:          0          0   IO-APIC-edge      bttv5
 14:      10429          0   IO-APIC-edge      ide0, bttv6
 15:          0          0   IO-APIC-edge      bttv7
 16:     100001          0   IO-APIC-fasteoi   uhci_hcd:usb2, 
uhci_hcd:usb5, bttv8
 17:     100001          0   IO-APIC-fasteoi   uhci_hcd:usb4, bttv9
 18:          2          0   IO-APIC-fasteoi   ehci_hcd:usb1, bttv10
 19:         39          0   IO-APIC-fasteoi   uhci_hcd:usb3, bttv11
 20:       1252          0   IO-APIC-fasteoi   eth0
NMI:          0          0 
LOC:     137954     137940 
ERR:          0
MIS:          0

What could be the problem? It seems that the irq handler doesn't "handle at 
all", but it's registered correctly.

Thanks.
-- 
-gaspa-
-----------------------------------------------
-------- https://launchpad.net/~gaspa ---------
------ HomePage: iogaspa.altervista.org -------
-Il lunedi'dell'arrampicatore: www.lunedi.org -
--- bttv-driver.c	2007-12-19 17:44:36.000000000 +0100
+++ ../bt8xx.copy/bttv-driver.c	2007-12-07 09:24:24.000000000 +0100
@@ -4771,48 +4743,6 @@
 
 	/* disable irqs, register irq handler */
 	btwrite(0, BT848_INT_MASK);
-    {    // gas stuff:
-        #define IRQ_START   8
-        static unsigned int bttv_last_assigned_irq = IRQ_START - 1 ;
-        unsigned int i = bttv_last_assigned_irq + 1 ;
-        unsigned long irqmask; 
-        free_irq(btv->c.pci->irq,NULL);
-        printk(KERN_INFO "MARK number 7\n");
-        irqmask = probe_irq_on();
-        probe_irq_off(irqmask);
-        printk(KERN_INFO "Starting guessing of a irq number (mask= %lx)\n",irqmask);
-        while( i <= 22){
-            unsigned int flags = 0;
-            printk(KERN_INFO "trying with irq number %d\n",i);
-            if( ( irqmask >> i ) & 0x01 )
-/*                flags = IRQF_DISABLED;*/
-                flags = IRQF_DISABLED | IRQF_SHARED;
-            else
-                flags = IRQF_DISABLED | IRQF_SHARED;
-            printk(KERN_INFO "requesting irq number %d\n",i);
-            result = request_irq( i , bttv_irq, flags ,btv->c.name,(void *)btv);
-            printk(KERN_INFO "requesting irq number %d - result: %d \n",i,result);
-            if ( result == 0 ){
-                printk(KERN_INFO "seems ok with irq number %d - %d \n",i,btv->c.pci->irq);
-                bttv_last_assigned_irq = i;
-/*                btv->c.pci->irq = i;*/
-                break;
-            }
-            printk(KERN_INFO "irq busy or request unsuccessfull\n");
-            i++;
-        }
-        if ( i > 22 ){
-            result = request_irq(btv->c.pci->irq, bttv_irq,
-                 IRQF_SHARED | IRQF_DISABLED,btv->c.name,(void *)btv);
-            printk(KERN_INFO "No irq available... limit: %d \n",i);
-            if (result < 0) {
-                printk(KERN_ERR "bttv%d: can't get IRQ %d\n",
-                       bttv_num,btv->c.pci->irq);
-                goto fail1;
-            }
-        }
-    }
-#if 0
 	result = request_irq(btv->c.pci->irq, bttv_irq,
 			     IRQF_SHARED | IRQF_DISABLED,btv->c.name,(void *)btv);
 	if (result < 0) {
@@ -4820,7 +4750,6 @@
 		       bttv_num,btv->c.pci->irq);
 		goto fail1;
 	}
-#endif 
 
 	if (0 != bttv_handle_chipset(btv)) {
 		result = -EIO;

[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