trivial patch to bttv for you... p.s. my machine hangs on modprobe.

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



My system hangs reproducibly and completely on "modprobe bttv", there is no error message.

Here is the trivial patch for a printk syntax error in bttv-driver.c (version 0.8.45) line #3271

       printk(KERN_INFO "bttv%d: Bt%d (rev %d) at %02x:%02x.%x, ",
              bttv_num,btv->id, btv->revision, dev->bus->number,
              PCI_SLOT(dev->devfn),PCI_FUNC(dev->devfn));

"KERN_INFO" should not be there, it's a printk, not a dprintk,
the next line is a printk without it, and that line is a continuation of the first.

Now that KERN_INFO is gone,  I can see:

bttv0: Bt878 (rev 17) @ 00:09.0 irq: 7, latency: 32 mmio: 0xcd000000

Used print statements every couple of lines to trace the code
(patch at the end, for illustration purposes) it hangs at
"btwrite(val, BT848_E_SCLOOP);" in init_bt848.

If I comment out  "btwrite(val, BT848_E_SCLOOP);" it just hangs on the next
line (O_SCLOOP), or the line after that if I comment that one out.

It is easy to do testing, I can print whatever you want, and send it to
someone who knows what it means, but I am no kernel hacker.
The CVS repository looks very old, I do not see any newer source code
anywhere other than 0.8.45.  Is there a place I should look?

What should I be looking at?

Where is there documentation about how btwrite works, what are
the magic constant codes used in btwrite, where is the docs on them?

any help appreciated.

Random potentially useful information:

-- the card id is 11002 (ATI TV Wonder... which is what it said on the retail box)
                 chips on card: BT878A, MSP3445G, PHILIPPS NTSC Tuner...
(bttv-cards.c lists the correct id, but a different PAL tuner, I am guessing it is PHILIPS tuner because it says "PHILIPS" on it)

grumpy% lspci
00:00.0 Host bridge: VIA Technologies, Inc. VT82C693A/694x [Apollo PRO133x] (rev c2) 00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598/694x [Apollo MVP3/Pro133x AGP] 00:04.0 ISA bridge: VIA Technologies, Inc. VT82C596 ISA [Mobile South] (rev 12)
00:04.1 IDE interface: VIA Technologies, Inc. Bus Master IDE (rev 06)
00:04.2 USB Controller: VIA Technologies, Inc. USB (rev 08)
00:04.3 Host bridge: VIA Technologies, Inc. VT82C596 Power Management (rev 20) 00:09.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11) 00:09.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
00:0b.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 08)
00:0b.1 Input device controller: Creative Labs SB Live! MIDI/Game Port (rev 08) 00:0e.0 Ethernet controller: 3Com Corporation 3c905B 100BaseTX [Cyclone] (rev 30) 01:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G400 AGP (rev 04)
grumpy%

grumpy% cat /proc/interrupts
          CPU0
 0:      66430          XT-PIC  timer
 1:       1402          XT-PIC  keyboard
 2:          0          XT-PIC  cascade
 5:        921          XT-PIC  eth0
12:      13992          XT-PIC  PS/2 Mouse
14:      13420          XT-PIC  ide0
15:         27          XT-PIC  ide1
NMI:          0
ERR:          0
grumpy%


*** bttv-0.8.45-/bttv-driver.c  Tue Aug 13 04:51:01 2002
--- bttv-0.8.45/bttv-driver.c   Sun Sep 15 21:39:12 2002
***************
*** 881,891 ****
 {
       int val;

       btwrite(0, BT848_SRESET);
!       btwrite(0x00, BT848_CAP_CTL);
       btwrite(BT848_COLOR_CTL_GAMMA, BT848_COLOR_CTL);
       btwrite(BT848_IFORM_XTAUTO | BT848_IFORM_AUTO, BT848_IFORM);

         /* set planar and packed mode trigger points and         */
         /* set rising edge of inverted GPINTR pin as irq trigger */
         btwrite(BT848_GPIO_DMA_CTL_PKTP_32|
--- 881,907 ----
 {
       int val;

+ printk("bttv: Peter! in init_bt848 - 1 about to btwrite(0,BT848_reset)!\n");
+
       btwrite(0, BT848_SRESET);
!
! printk("bttv: Peter! in init_bt848 - 2 btwrite(0x00,BT848_CAP_CTL)!\n");
!
!       btwrite(0x00, BT848_CAP_CTL);
!
!       printk("bttv: Peter! in init_bt848 - 3 !\n");
!
!
       btwrite(BT848_COLOR_CTL_GAMMA, BT848_COLOR_CTL);
+
+       printk("bttv: Peter! in init_bt848 - 4 !\n");
+
       btwrite(BT848_IFORM_XTAUTO | BT848_IFORM_AUTO, BT848_IFORM);

+       printk("bttv: Peter! in init_bt848 - 5 !\n");
+
+
+
         /* set planar and packed mode trigger points and         */
         /* set rising edge of inverted GPINTR pin as irq trigger */
         btwrite(BT848_GPIO_DMA_CTL_PKTP_32|
***************
*** 895,909 ****
                 BT848_GPIO_DMA_CTL_GPINTI,
                 BT848_GPIO_DMA_CTL);

       val = btv->opt_chroma_agc ? BT848_SCLOOP_CAGC : 0;
-         btwrite(val, BT848_E_SCLOOP);
-         btwrite(val, BT848_O_SCLOOP);

         btwrite(0x20, BT848_E_VSCALE_HI);
         btwrite(0x20, BT848_O_VSCALE_HI);
btwrite(BT848_ADC_RESERVED | (btv->opt_adc_crush ? BT848_ADC_CRUSH : 0),
               BT848_ADC);

       if (btv->opt_lumafilter) {
               btwrite(0, BT848_E_CONTROL);
               btwrite(0, BT848_O_CONTROL);
--- 911,937 ----
                 BT848_GPIO_DMA_CTL_GPINTI,
                 BT848_GPIO_DMA_CTL);

+ printk("bttv: Peter! in init_bt848 - 6 btv->bt848_mmio=%08lx!\n", (unsigned long)(btv->bt848
_mmio));
+
       val = btv->opt_chroma_agc ? BT848_SCLOOP_CAGC : 0;

+ printk("bttv: Peter! in init_bt848 - 6.1 val=%d, skipping btwrite(val, BT848_E_SCLOOP);!\n",
val);
+         btwrite(val, BT848_E_SCLOOP);
+ printk("bttv: Peter! in init_bt848 - 6.2 val=%d, about to btwrite(val, BT848_O_SCLOOP);!\n",
val);
+         btwrite(val, BT848_O_SCLOOP);
+
+
+       printk("bttv: Peter! in init_bt848 - 7 !\n");
+
+       /* Peter! the two below hang as well */
         btwrite(0x20, BT848_E_VSCALE_HI);
         btwrite(0x20, BT848_O_VSCALE_HI);
+
btwrite(BT848_ADC_RESERVED | (btv->opt_adc_crush ? BT848_ADC_CRUSH : 0),
               BT848_ADC);

+       printk("bttv: Peter! in init_bt848 - 8 !\n");
+
       if (btv->opt_lumafilter) {
               btwrite(0, BT848_E_CONTROL);
               btwrite(0, BT848_O_CONTROL);
***************
*** 911,916 ****
--- 939,945 ----
               btwrite(BT848_CONTROL_LDEC, BT848_E_CONTROL);
               btwrite(BT848_CONTROL_LDEC, BT848_O_CONTROL);
       }
+       printk("bttv: Peter! in init_bt848 - 9 !\n");
 }

 extern void bttv_reinit_bt848(struct bttv *btv)
***************
*** 3059,3071 ****
       }

       if (-1 != latency) {
! printk(KERN_INFO "bttv%d: setting pci latency timer to %d\n",
                      bttv_num,latency);
               pci_write_config_byte(dev, PCI_LATENCY_TIMER, latency);
       }
         pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision);
         pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
!         printk(KERN_INFO "bttv%d: Bt%d (rev %d) at %02x:%02x.%x, ",
                bttv_num,btv->id, btv->revision, dev->bus->number,
              PCI_SLOT(dev->devfn),PCI_FUNC(dev->devfn));
         printk("irq: %d, latency: %d, mmio: 0x%lx\n",
--- 3088,3100 ----
       }

       if (-1 != latency) {
! dprintk(KERN_INFO "bttv%d: setting pci latency timer to %d\n",
                      bttv_num,latency);
               pci_write_config_byte(dev, PCI_LATENCY_TIMER, latency);
       }
         pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision);
         pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
!         printk("bttv%d: Bt%d (rev %d) at %02x:%02x.%x, ",
                bttv_num,btv->id, btv->revision, dev->bus->number,
              PCI_SLOT(dev->devfn),PCI_FUNC(dev->devfn));
         printk("irq: %d, latency: %d, mmio: 0x%lx\n",
***************
*** 3081,3086 ****
--- 3110,3118 ----
         /* identify card */
       bttv_idcard(btv);

+       printk("bttvnum=%d, nr=%d, cardid=%0lx name=+%s+",
+          bttv_num, btv->nr, btv->cardid, btv->name); /* Peter */
+
         /* disable irqs, register irq handler */
       btwrite(0, BT848_INT_MASK);
         result = request_irq(btv->dev->irq, bttv_irq,
***************
*** 3090,3095 ****
--- 3122,3128 ----
                      bttv_num,btv->dev->irq);
               goto fail1;
         }
+ printk(KERN_ERR "bttv%d: got IRQ %d\n", bttv_num,btv->dev->irq); /* Peter */

       if (0 != bttv_handle_chipset(btv)) {
               result = -EIO;
***************
*** 3116,3130 ****
--- 3149,3175 ----
         if (bttv_gpio)
                 bttv_gpio_tracking(btv,"pre-init");

+       printk("bttv: Peter! about to run init main functions!\n");
+
       bttv_risc_init_main(btv);
+
+         /* Peter! it hangs after here! */
+
       init_bt848(btv);

+         /* Peter! it hangs before here! */
+       printk("bttv: Peter! returned from init_bt848 - 10 !\n");
+         goto fail1; /* Peter! you sly dog... */
+
       /* gpio */
+       /* Peter!
         btwrite(0x00, BT848_GPIO_REG_INP);
         btwrite(0x00, BT848_GPIO_OUT_EN);
+        */
         if (bttv_gpio)
                 bttv_gpio_tracking(btv,"init");

+       printk("bttv: Peter! returned from init_bt848 - 11 !\n");
         /* interrupt */
         btwrite(0xfffffUL, BT848_INT_STAT);
         btwrite((btv->triton1) |
***************
*** 3135,3146 ****
--- 3180,3195 ----
                 BT848_INT_FMTCHG|BT848_INT_HLOCK,
                 BT848_INT_MASK);

+       printk("bttv: Peter! returned from init_bt848 - 12 !\n");
+       /* Peter! Definitely hung by here.... */
         /* needs to be done before i2c is registered */
         bttv_init_card1(btv);

+       printk("bttv: Peter! returned from init_bt848 - 13 !\n");
         /* register i2c */
         init_bttv_i2c(btv);

+       printk("bttv: Peter! returned from init_bt848 - 14 !\n");
         /* some card-specific stuff (needs working i2c) */
         bttv_init_card2(btv);







[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux