Bug 9876

Summary: cx8800 segfaults on LifeView NOT Hybrid PCI! LV3H with Xceive
Product: v4l-dvb Reporter: Adam Pribyl (covex)
Component: cx88Assignee: Mauro Carvalho Chehab (mchehab)
Status: REJECTED INSUFFICIENT_DATA    
Severity: normal CC: protasnb
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.23.14-107.fc8 and 2.6.24 Subsystem:
Regression: --- Bisected commit-id:

Description Adam Pribyl 2008-02-02 12:17:15 UTC
Latest working kernel version: NA
Earliest failing kernel version: NA
Distribution: Fedora
Hardware Environment: i686
Software Environment: NA
Problem Description: 

segfault:
CORE cx88[0]: subsystem: 14f1:8852, board: UNKNOWN/GENERIC [card=0,autodetected]
TV tuner 71 at 0x1fe, Radio tuner -1 at 0x1fe
tuner 1-0061: chip found @ 0xc2 (cx88[0])
tuner 1-0061: type set to 71 (Xceive xc3028)
tuner 1-0061: type set to 71 (Xceive xc3028)
cx88[0]/0: found at 0000:00:10.0, rev: 5, irq: 10, latency: 64, mmio: 0xdc000000
cx88[0]/0: registered device video0 [v4l2]
cx88[0]/0: registered device vbi0
BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000
printing eip: f1a33269 *pde = 21f4e067 *pte = 00000000 
Oops: 0000 [#1] SMP 
Modules linked in: cx8800 cx88xx nf_conntrack_netbios_ns ipt_REJECT xt_tcpudp xt_state iptable_filter ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nfnetlink ip_tables x_tables vfat fat dm_multipath radeon drm ipv6 snd_au8820 gameport snd_ac97_codec snd_sb16 snd_opl3_lib snd_hwdep snd_sb16_dsp snd_sb_common snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq tuner snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_page_alloc ac97_bus ir_common snd_mpu401_uart i2c_algo_bit snd_rawmidi snd_seq_device tveeprom floppy snd videodev ne2k_pci i2c_viapro button v4l1_compat compat_ioctl32 v4l2_common pcspkr soundcore video_buf fealnx parport_pc btcx_risc i2c_core 8390 mii via686a hwmon parport sg sr_mod cdrom dm_snapshot dm_zero dm_mirror dm_mod pata_via ata_generic libata sd_mod scsi_mod ext3 jbd mbcache uhci_hcd ohci_hcd ehci_hcd
CPU:    0
EIP:    0060:[<f1a33269>]    Not tainted VLI
EFLAGS: 00210213   (2.6.23.14-107.fc8 #1)
EIP is at default_set_tv_freq+0xa1/0x9bd [tuner]
eax: 00000000   ebx: 00000000   ecx: ffffffff   edx: 00000000
esi: f1a3df34   edi: ef278200   ebp: 00000003   esp: e1efac48
ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068
Process modprobe (pid: 2571, ti=e1efa000 task=e1fc8000 task.ti=e1efa000)
Stack: 00000006 cb5a7f23 00000006 c176d230 e1fc8000 c176d230 e1efac78 c042ab57 
       000f4240 00000000 00000001 00000001 f1a3df34 c0427c65 eff8319c 00000001 
       00001900 ef278200 00000047 00000000 000002dc 00000000 0000003f c160b180 
Call Trace:
 [<c042ab57>] check_preempt_curr_fair+0x6b/0x71
 [<c0427c65>] try_to_wake_up+0x2ef/0x2f9
 [<f1a31807>] set_tv_freq+0x112/0x119 [tuner]
 [<c043d4a6>] autoremove_wake_function+0x15/0x35
 [<c04244ce>] __wake_up_common+0x32/0x55
 [<f1a318f7>] set_freq+0xe9/0xf7 [tuner]
 [<f1a327c3>] tuner_command+0x5f0/0xf05 [tuner]
 [<c04041be>] __switch_to+0xcb/0x149
 [<f0931901>] i2c_clients_command+0x71/0xa9 [i2c_core]
 [<f09d7358>] cx88_set_tvnorm+0x7cb/0x7d7 [cx88xx]
 [<f09f10df>] cx8800_initdev+0x423/0x4fd [cx8800]
 [<c04f2c6e>] kobject_get+0xf/0x13
 [<c0500577>] pci_device_probe+0x36/0x57
 [<c0567137>] driver_probe_device+0xea/0x168
 [<c04f3705>] kobject_uevent_env+0x37a/0x3a1
 [<c056725b>] __driver_attach+0x0/0xa5
 [<c05672cb>] __driver_attach+0x70/0xa5
 [<c05666c3>] bus_for_each_dev+0x39/0x5b
 [<c0566f92>] driver_attach+0x16/0x18
 [<c056725b>] __driver_attach+0x0/0xa5
 [<c05669a7>] bus_add_driver+0x6d/0x16d
 [<c05006a6>] __pci_register_driver+0x48/0x74
 [<c044ab96>] sys_init_module+0x150d/0x1651
 [<c062086a>] do_page_fault+0x2c0/0x5ef
 [<f0950414>] videobuf_mmap_free+0x0/0x52 [video_buf]
 [<c040518a>] syscall_call+0x7/0xb
 =======================
Code: 35 00 00 80 00 09 d8 c7 44 24 50 1f 02 00 00 74 0c c7 44 24 50 6f 02 00 00 66 bd 01 00 8b 44 24 30 31 db 8b 48 04 31 c0 49 eb 09 <3b> 2c 10 74 5d 43 83 c0 14 8b 74 24 30 39 cb 8b 56 08 75 ec 6b 
EIP: [<f1a33269>] default_set_tv_freq+0xa1/0x9bd [tuner] SS:ESP 0068:e1efac48

Steps to reproduce:
modprobe cx88xx tuner=71 #Xceive xc3028
modprobe cx8800


All information for this card I gathered is on
https://www.lowlevel.cz/log/pivot/entry.php?id=117
Comment 1 Adam Pribyl 2008-02-04 13:26:25 UTC
For mainline the trace is bit different:
tuner 1-0061: chip found @ 0xc2 (cx88[0])
tuner-simple 1-0061: type set to 71 (Xceive xc3028)
tuner 1-0061: type set to Xceive xc3028
tuner-simple 1-0061: type set to 71 (Xceive xc3028)
tuner 1-0061: type set to Xceive xc3028
cx88[0]/0: registered device video0 [v4l2]
cx88[0]/0: registered device vbi0
BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000
printing eip: f09eb3a3 *pde = 00000000 
Oops: 0000 [#1] SMP 
Modules linked in: tuner cx8800 cx88xx ir_common i2c_algo_bit videobuf_dma_sg videobuf_core btcx_risc tveeprom videodev v4l2_common v4l1_compat ipv6 nf_conntrack_netbios_ns ipt_REJECT xt_tcpudp xt_state iptable_filter ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack ip_tables x_tables vfat fat dm_multipath snd_au8820 gameport snd_ac97_codec snd_sb16 snd_opl3_lib snd_hwdep snd_sb16_dsp snd_sb_common snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq tea5767 tda8290 snd_pcm_oss tuner_simple mt20xx snd_mixer_oss snd_pcm snd_timer snd_page_alloc ac97_bus snd_mpu401_uart snd_rawmidi snd_seq_device compat_ioctl32 snd soundcore ne2k_pci floppy pcspkr i2c_viapro 8390 fealnx i2c_core mii via686a hwmon button parport_pc parport sr_mod sg cdrom dm_snapshot dm_zero dm_mirror dm_mod pata_via ata_generic libata sd_mod scsi_mod ext3 jbd mbcache uhci_hcd ohci_hcd ehci_hcd

Pid: 2390, comm: modprobe Not tainted (2.6.24 #1)
EIP: 0060:[<f09eb3a3>] EFLAGS: 00210213 CPU: 0
EIP is at simple_set_params+0x34c/0xcc5 [tuner_simple]
EAX: 00000000 EBX: 00000000 ECX: ffffffff EDX: 00000000
ESI: f1c4b554 EDI: eee25ca0 EBP: 00000003 ESP: ef0fdc18
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process modprobe (pid: 2390, ti=ef0fd000 task=eea28d20 task.ti=ef0fd000)
Stack: eea4e0d4 ffffffff ffffffff c04eb4ea ef0fdc66 eea4e884 0060b700 ef0fdc66 
       eea4e130 ffffffff ffffffff c04eb4ea f1c4b554 eea4e884 00000001 ef2f13e8 
       ef0fdca4 99ff6009 c1607c1c 000002dc eed22690 eed226c0 c1607c00 c04222d8 
Call Trace:
 [<c04eb4ea>] number+0x147/0x215
 [<c04eb4ea>] number+0x147/0x215
 [<c04222d8>] enqueue_entity+0x110/0x124
 [<f1c44100>] fe_set_freq+0x77/0x7e [tuner]
 [<f1c43846>] set_tv_freq+0x10f/0x115 [tuner]
 [<c042362d>] __wake_up+0x32/0x42
 [<f1c43935>] set_freq+0xe9/0xf7 [tuner]
 [<c042130a>] __wake_up_common+0x32/0x5c
 [<f1c44ccd>] tuner_command+0x5fa/0xfc1 [tuner]
 [<c04218b1>] update_curr+0x88/0x100
 [<f092c895>] i2c_clients_command+0x71/0xa9 [i2c_core]
 [<f0a012ed>] cx88_set_tvnorm+0x7b3/0x7be [cx88xx]
 [<f09c304f>] cx8800_initdev+0x447/0x52e [cx8800]
 [<c04e8596>] kobject_get+0xf/0x13
 [<c04f6ffb>] pci_device_probe+0x36/0x57
 [<c055d894>] driver_probe_device+0xde/0x15c
 [<c04e9059>] kobject_uevent_env+0x353/0x377
 [<c055d9b8>] __driver_attach+0x0/0xa5
 [<c055da28>] __driver_attach+0x70/0xa5
 [<c055ce1e>] bus_for_each_dev+0x37/0x59
 [<c055d6fb>] driver_attach+0x16/0x18
 [<c055d9b8>] __driver_attach+0x0/0xa5
 [<c055d104>] bus_add_driver+0x6d/0x197
 [<c04f712a>] __pci_register_driver+0x48/0x74
 [<c044a3de>] sys_init_module+0x14ad/0x15d0
 [<c047c613>] do_sync_read+0xc7/0x10a
 [<f0981581>] videobuf_mmap_free+0x0/0x1e [videobuf_core]
 [<c0404f1e>] syscall_call+0x7/0xb
 =======================
Code: 35 00 00 80 00 09 d8 c7 44 24 4c 1f 02 00 00 74 0c c7 44 24 4c 6f 02 00 00 66 bd 01 00 8b 44 24 30 31 db 8b 48 04 31 c0 49 eb 09 <3b> 2c 10 74 52 43 83 c0 14 8b 74 24 30 39 cb 8b 56 08 75 ec 6b 
EIP: [<f09eb3a3>] simple_set_params+0x34c/0xcc5 [tuner_simple] SS:ESP 0068:ef0fdc18
---[ end trace d8c35fc2ada58232 ]---
Comment 2 Mauro Carvalho Chehab 2008-02-05 02:30:02 UTC
xc3028 support for cx88 is not in mainline yet. Could you please try to use this tree, instead:

http://linuxtv.org/hg/~mchehab/cx88-xc2028/

You should clone it with mercurial (hg) or download the latest tarball.
Comment 3 Adam Pribyl 2008-02-06 04:05:08 UTC
OK with this tree the segfault is gone and card is detected like this:

Linux video capture interface: v2.00
cx88/2: cx2388x MPEG-TS Driver Manager version 0.0.6 loaded
cx88[0]: subsystem: 14f1:8852, board: Geniatech X8000-MT DVBT [card=63,autodetected]
cx88[0]: TV tuner type 71, Radio tuner type 0
cx88/0: cx2388x v4l2 driver version 0.0.6 loaded
cx88[0]/2: cx2388x 8802 Driver Manager
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 10
ACPI: PCI Interrupt 0000:00:10.2[A] -> Link [LNKC] -> GSI 10 (level, low) -> IRQ 10
cx88[0]/2: found at 0000:00:10.2, rev: 5, irq: 10, latency: 64, mmio: 0xde000000
ACPI: PCI Interrupt 0000:00:10.0[A] -> Link [LNKC] -> GSI 10 (level, low) -> IRQ 10
cx88[0]/0: found at 0000:00:10.0, rev: 5, irq: 10, latency: 64, mmio: 0xdc000000
tuner' 1-0061: chip found @ 0xc2 (cx88[0])
xc2028 1-0061: type set to XCeive xc2028/xc3028 tuner
xc2028 1-0061: xc2028/3028 firmware name not set!
cx88[0]/0: registered device video0 [v4l2]
cx88[0]/0: registered device vbi0
cx88[0]/0: registered device radio0
xc2028 1-0061: xc2028/3028 firmware name not set!
cx88/2: cx2388x dvb driver version 0.0.6 loaded
cx88/2: registering cx8802 driver, type: dvb access: shared
cx88[0]/2: subsystem: 14f1:8852, board: Geniatech X8000-MT DVBT [card=63]
cx88[0]/2: cx2388x based DVB/ATSC card
cx2388x alsa driver version 0.0.6 loaded
ACPI: PCI Interrupt 0000:00:10.1[A] -> Link [LNKC] -> GSI 10 (level, low) -> IRQ 10
cx88[0]/1: CX88x/0: ALSA support for cx2388x boards
xc2028 1-0061: type set to XCeive xc2028/xc3028 tuner
DVB: registering new adapter (cx88[0])
DVB: registering frontend 0 (Zarlink ZL10353 DVB-T)...
ACPI: PCI Interrupt 0000:00:11.0[A] -> Link [LNKD] -> GSI 10 (level, low) -> IRQ 10

Sofar ok.. I can not tune anything, but thats probably another story.

Thanx for your attention.
Comment 4 Mauro Carvalho Chehab 2008-03-13 07:50:11 UTC
Could you please try the latest driver, at:
http://linuxtv.org/hg/v4l-dvb ?

You will need to extract a xc3028 firmware, by using
Documentation/video4linux/extract_xc3028.pl

The instructions are documented at the beginning of extract_xc3028.pl.
Comment 5 Adam Pribyl 2008-03-14 08:03:13 UTC
The segfault is not present in svn code. Regarding the firmware we had the email conversation with av88base.sys file. So far I was not successful extracting the correct firmwares from this file. There seems to be 11 base firmwares and lot of std parts. Finding correct type for each of them seems almost impossible to me, by just triing all possible combinations. I do not know any better way how to find the firmware types.
Comment 6 Natalie Protasevich 2008-06-01 23:28:33 UTC
Mauro, were the fixes merged to main line? If so we can close the bug.
Comment 7 Alan 2009-03-24 04:26:04 UTC
Closing stale bug (NEEDINFO for months)