Menu

#34 "Kernel level thread crashes"

open
None
7
2014-07-26
2005-09-17
No

Hi!
I do not know what causes this behaviour, but
when loading the rivatv module a kernel level
thread (???) seems to crash. But the kernel does
not panic.
Output from dmesg:

usbcore: registered new driver hub
USB Universal Host Controller Interface driver v2.2
uhci_hcd 0000:00:07.2: init 0000:00:07.2 fail, -16
uhci_hcd: probe of 0000:00:07.2 failed with error
-16
uhci_hcd 0000:00:07.3: VIA Technologies, Inc.
VT82xxxxx UHCI USB 1.1 Controller (#2)
uhci_hcd 0000:00:07.3: new USB bus registered,
assigned bus number 1
uhci_hcd 0000:00:07.3: request interrupt 12 failed
uhci_hcd 0000:00:07.3: USB bus 1 deregistered
uhci_hcd 0000:00:07.3: init 0000:00:07.3 fail, -16
uhci_hcd: probe of 0000:00:07.3 failed with error
-16
PCI: Unable to reserve I/O region #1:100@ac00
for device 0000:00:07.5
VIA 82xx Audio: probe of 0000:00:07.5 failed with
error -16
PCI: Setting latency timer of device 0000:00:07.6
to 64
*rivatv: Video4Linux driver for NVIDIA cards
rivatv: MMX processor extension enabled
rivatv: nVidia card found - rivatv0
rivatv: Identified your board as Elsa Victory Erazor
rivatv: Attempting to load module vpx32xx
rivatv: MTRR successfully enabled
rivatv: PCI nVidia NV3 card detected (RIVA 128
[0x18], 4MB @ 0xD2000000)
rivatv: I2C adapter driver for NVIDIA cards
rivatv: video decoder chip registered
VPX32XX: vpx32xx attached
VPX32XX: chip detection: MICRONAS
INTERMETALL VPX3225D detected
scheduling while atomic:
modprobe/0x00000001/2579
[<c035abb4>] schedule+0x5f4/0x780
[<c0116d59>] __wake_up_common+0x39/0x70
[<c035a415>] __down+0xd5/0x100
[<c0116d10>] default_wake_function+0x0/0x10
[<c035a55f>] __down_failed+0x7/0xc
[<c035c3f4>] .text.lock.kernel_lock+0x28/0x37
[<f8f034d7>] bit_riva_setsda+0x27/0xe0 [rivatv]
[<c02a2414>] i2c_stop+0x74/0xb0
[<c02a2f2c>] bit_xfer+0x33c/0x770
[<c02a2414>] i2c_stop+0x74/0xb0
[<c02a0ee6>] i2c_master_send+0x56/0xb0
[<f8ea9244>] vpx32xx_writeFP+0x114/0x170
[vpx32xx]
[<f8ea97db>] vpx322x_setup_scaler+0x2b/0x140
[vpx32xx]
[<f8ea9955>]
vpx322x_setup_standard+0x65/0x220 [vpx32xx]
[<f8ea9f6f>]
vpx322x_set_video_norm+0xbf/0x120 [vpx32xx]
[<f8eaa45b>] vpx32xx_detect+0x29b/0x300
[vpx32xx]
[<c02a1218>] i2c_probe+0x1c8/0x2d0
[<f8eaa1c0>] vpx32xx_detect+0x0/0x300
[vpx32xx]
[<c02a02c5>] i2c_add_adapter+0x1f5/0x220
[<c02a33a4>] i2c_bit_add_bus+0x34/0x60
[<f8e8a31e>] rivatv_setup_i2c+0x26e/0x2a0
[rivatv]
[<f8e8a3bf>] rivatv_register_i2c+0x6f/0x90
[rivatv]
[<f8e89cab>] rivatv_init_pci+0x46b/0x870 [rivatv]
[<c01f4445>] pci_device_probe_static+0x35/0x40
[<c01f4480>] __pci_device_probe+0x30/0x50
[<c01f44c3>] pci_device_probe+0x23/0x40
[<c0232729>] driver_probe_device+0x29/0x70
[<c0232884>] driver_attach+0x54/0x90
[<c01eb044>] kobject_register+0x34/0x70
[<c0232d12>] bus_add_driver+0x92/0xd0
[<c01f4713>] pci_register_driver+0x73/0xa0
[<c01379d0>] sys_init_module+0xd0/0x220
[<c0102e01>] syscall_call+0x7/0xb
rivatv: procfs file registered for rivatv0
rivatv: allocated YUV capture buffer (812 kb)
rivatv: AGPGART: version 0.101
rivatv: AGPGART: aperture is 256MB @
0xC0000000, AGP 1x 2x 4x supported
rivatv: AGP: disabled
rivatv: Hash table layout: 4kB (9 bits) @
0xD2C00000
rivatv: No additional driver detected
rivatv: PFIFO and PGRAPH disabled, enabling...
rivatv: Setting up instance RAM for DMA
rivatv: DMA transfers disabled
rivatv: PMEDIA, PVIDEO and PFB disabled,
enabling...
rivatv: successfully requested IRQ 10
rivatv: Video4Linux device driver registered
ip6_tables: (C) 2000-2002 Netfilter core team

Information requested, when reporting bugs:

Driver Version:
I am using the latest CVS version
(date: Sa Sep 17 19:32:15 CEST 2005)

Board:
Elsa Victory Erazor

Cipset:
NVidia / SGS Thomson (Joint Venture) Riva128
(rev 10)

Linux Kernel Version:
2.6.12.1

cat /proc/driver/rivatv0
nVidia Chip: RIVA 128
Model: Elsa Victory Erazor
Architecture: NV3 (NV3)
Access: Control [0xd0000000-0xd0ffffff]
FB [0xd2000000-0xd2ffffff]
Interrupts: 0 out of 91531 (DMA: 0, Overlay: 0,
Missing: 91531)
Device: available
VideoDecoder: Micronas VPX32xx
Tuner: unavailable
AudioDecoder: unavailable
AudioProcessor: unavailable
IR chip: unavailable

Very important note:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!! I am using a SMP machine !!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Please contact me if you need assistance for
debugging. I am going to help you as much as I
can.

Discussion

  • Creature of Swamp

    • priority: 5 --> 7
     
  • Creature of Swamp

    Logged In: YES
    user_id=1304731

    The driver is showing the same behaviour as described
    in the Bugreport "rivatv 8.3.0 on ELSA Erazor I PCI
    freezes machine". I assume, that these bug reports are
    related.
    Additional information:
    When calling v4l-info form the xawtv distribution,
    v4l-info dumps all information to the commandline. A
    second after the complete dump ( prompt is being
    displayed ), the machine freezes. I assume, that there
    must be a livelock, because you can hear the CPU fans
    speed up to maximum speed. This happens, if the
    CPUs are under load.
    Additional environment information:
    The kernel was compiled using gcc (GCC) 4.0.2
    20050821 (prerelease).

     
  • Stefan Jahn

    Stefan Jahn - 2005-09-19
    • assigned_to: nobody --> ela
     
  • Stefan Jahn

    Stefan Jahn - 2005-09-19

    Logged In: YES
    user_id=80302

    Hello!

    Can you please try to change

    I2C_CLASS_DDC into I2C_CLASS_HWMON

    and/or

    I2C_ADAP_CLASS_DDC into I2C_ADAP_CLASS_SMBUS

    in the i2c_riva_bus0 structure in the i2c-riva.c file?

    Probably this helps...

     
  • Creature of Swamp

    Logged In: YES
    user_id=1304731

    > Can you please try to change
    > I2C_CLASS_DDC into I2C_CLASS_HWMON
    > and/or
    > I2C_ADAP_CLASS_DDC into
    > I2C_ADAP_CLASS_SMBUS
    > in the i2c_riva_bus0 structure in the i2c-riva.c file?

    Sorry, none of the possible combinations helps. Driver
    continues to crash. Perhaps hidden SMP problem????

     
  • Stefan Jahn

    Stefan Jahn - 2005-09-20

    Logged In: YES
    user_id=80302

    Yet another try: remove lock_kernel() and unlock_kernel() in
    the 'i2c-riva.c' file...

     
  • Creature of Swamp

    Logged In: YES
    user_id=1304731

    > Yet another try: remove lock_kernel() and unlock_kernel() in
    > the 'i2c-riva.c' file...

    We seem to be on the right way ...
    I removed the lock and unlock in the *original version* of
    i2c-rova.c (No modifications to the constants of the first try.)

    Now the modlues load cleanly without crashing.
    BUT:
    - v4l-info dumps all information and after a second the
    computers hangs up.

    - rmmod rivatv ; rmmod vpx32xx works in this order
    BUT:
    - rmmod vpx32xx ; rmmod rivatv causes my computer to hang
    up after 2 seconds or something like that.

     
  • Stefan Jahn

    Stefan Jahn - 2005-09-21

    Logged In: YES
    user_id=80302

    Hmpf. Probably also the spinlock_* functions? Try playing
    with the LOCK_ macro... Probably you find a usable
    combination...

     
  • Creature of Swamp

    Logged In: YES
    user_id=1304731

    It seems to me that is is getting difficulty.
    There are two possibilities:
    1. We are going to wait until 5th october. Then we are
    going to have an online debug session. If you are going
    to setup IPv6 you will be able to log into my machine. If
    you need a tunnel broker search for "tunnel broker" in
    google or use www.freenet6.net or www.sixxs.net . We
    could use ICQ or talk in order to have interactive
    discussion.
    2. I am going to send you a card ( Elsa Victory Erazor
    @ ebay 1 EUR + shipment ) as a donnation.

    What do you want to do?

     
  • Stefan Jahn

    Stefan Jahn - 2005-09-23

    Logged In: YES
    user_id=80302

    Hello! Unfortunately I do not have access to the internet at
    home and I can't misuse the access at work for this...
    Probaly you may really try to remove

    spin_lock_irqsave () from the LOCK_I2C_RIVA macro

    and

    spin_unlock_irqrestore () UNLOCK_I2C_RIVA macro

    This and with the lock_kernel()/unlock_kernel() in place..

     
  • Creature of Swamp

    Logged In: YES
    user_id=1304731

    Hi!
    Sorry, suggestion does not help ...
    It seems to me that we have got stuck. This problem will
    have to wait for two weeks. After that, I decided to
    have an extended debugging session. Detailled plans:
    1. Find out, what system calls are called form v4l-info.
    2. Find out, which lock causes the machine to hang.
    3. Find out, wheter we are dealing with an SMP problem
    or not ( => test card on an non-SMP host )
    4. Develop fix for this issuse ( perhaps )
    At least I am going to provide more detailled debugging
    information.
    Is it possible to use the driver with kernel version 2.6.7?
    The most comfortable way would be to use kgdb. kgdb
    is only availible for kernel version 2.6.7.

     
  • Stefan Jahn

    Stefan Jahn - 2005-09-23

    Logged In: YES
    user_id=80302

    Nice suggestion :-) Thanks for your efforts in advance!
    RivaTV can be used with kernel 2.6.7... to answer your
    question.

     
  • Creature of Swamp

    Logged In: YES
    user_id=1304731

    Hi!
    I had a debugging session last light and this morning. I was
    analysing the code of v4l-info.
    The results:
    1. v4l-info opens /dev/video0, calls several times ioctl and
    fillany crashes *after* the program has finished. After some
    time of thinking, if found out, that the close system call
    was missing in v4l-info. I.e the close system call causes
    the system to hang.
    Here is my test program (quick and very dirty):

    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <string.h>
    #include <errno.h>
    #include <fcntl.h>
    #include <inttypes.h>
    #include <ctype.h>
    /*function used, in order to make sure, that there are no
    side effects,
    which could be mixed between different system calls.*/
    void suspend() {
    unsigned int count=90;
    printf("Sleeping for 90 seconds ... \n");
    for ( ; count > 0; count--){
    sleep(1);
    printf("%u\n", count);
    }
    printf("done. \n");
    }

    /*
    ---------------------------------------------------------------------
    */
    /* main
    */
    int main(int argc, char *argv[])
    {
    char dummy[256];
    char *device = "/dev/video0";
    int tab = 1, ok = 0;
    int fd;

    if (argc > 1)
    device = argv[1];

    printf("Running open system call ... ");
    fd = open(device,O_RDONLY);

    if (-1 == fd) {
    fprintf(stderr,"open %s:
    %s\n",device,strerror(errno));
    exit(1);
    };
    printf("done.\n");
    suspend();
    printf("Running close system call ... ");
    if(close(fd)){
    fprintf(stderr,"Close system call failed.\n");
    exit(1);
    }
    printf("done.\n");
    suspend();

    return 0;
    }

    The test Program prints:

    Running open system call ... done
    Sleeping for 90 seconds ...
    90
    89
    88
    ...
    0
    done.
    Running close system call ... done.
    Sleeping for 90 seconds ...

    Now my machine hangs . This means, that the close system
    call is able to finish successfully, but something causes
    the mahine to hang after the system call has finished.

    Any ideas?

    In order to a have a working kgdb setup, you will have to
    wait for some time. There are still some problems which have
    to be solved in my working environment.

    Greetings
    Frank

     

Log in to post a comment.

MongoDB Logo MongoDB