Hi all, I''m trying to get the ivtv (ivtv.sf.net) drivers to load in a non-dom0 kernel. They run just great in domain 0. But when I mask the TV capture cards (3 of them) from domain 0 and present them to a domU, I can''t get the driver to load properly. lspci shows the cards in the domU: 0000:02:01.0 Multimedia video controller: Internext Compression Inc iTVC15 MPEG-2 Encoder (rev 01) 0000:02:02.0 Multimedia video controller: Internext Compression Inc iTVC16 (CX23416) MPEG-2 Encoder (rev 01) 0000:02:03.0 Multimedia video controller: Internext Compression Inc iTVC15 MPEG-2 Encoder (rev 01) When I modprobe an unmodified ivtv 0.2.0-rc3k driver, I get this in dmesg: Linux video capture interface: v1.00 ivtv: ==================== START INIT IVTV ===================ivtv: version 0.2.0 (rc3j) loading ivtv: Linux version: 2.6.11-xenU PENTIUM4 4KSTACKS gcc-3.3 ivtv: In case of problems please include the debug info ivtv: between the START INIT IVTV and END INIT IVTV lines when ivtv: mailing the ivtv-devel mailinglist. ivtv: Autodetected WinTV PVR 250 card ivtv: Found an iTVC15 based chip PCI: Obtained IRQ 22 for device 0000:02:01.0 ivtv: Unreasonably low latency timer, setting to 64 (was 32) Unable to handle kernel NULL pointer dereference at virtual address 00000024 printing eip: d08abe25 *pde = ma 00000000 pa 55555000 [<d08ac037>] ivtv_probe+0x97/0xa00 [ivtv] [<c0255ab2>] pci_device_probe_static+0x52/0x70 [<c0255b0c>] __pci_device_probe+0x3c/0x50 [<c0255b4c>] pci_device_probe+0x2c/0x50 [<c0274d0f>] driver_probe_device+0x2f/0x80 [<c0274e5c>] driver_attach+0x5c/0xa0 [<c02753ad>] bus_add_driver+0x9d/0xd0 [<c02759cf>] driver_register+0x2f/0x40 [<c0255dc4>] pci_register_driver+0x64/0x90 [<d08ace7c>] module_start+0xcc/0x1f0 [ivtv] [<c01309f2>] sys_init_module+0x152/0x1e0 [<c0109040>] syscall_call+0x7/0xb Oops: 0000 [#1] Modules linked in: ivtv i2c_algo_bit videodev ehci_hcd uhci_hcd usbcore CPU: 0 EIP: 0061:[<d08abe25>] Not tainted VLI EFLAGS: 00010246 (2.6.11-xenU) EIP is at ivtv_setup_pci+0x1e5/0x360 [ivtv] eax: 00000000 ebx: 00000000 ecx: 00000000 edx: 00000000 esi: c047c000 edi: d08d0d20 ebp: c047c000 esp: ce6cce84 ds: 007b es: 007b ss: 0069 Process modprobe (pid: 5089, threadinfo=ce6cc000 task=ce9a6590) Stack: 00000000 00000000 00000040 0000ffff c0345360 d08c3478 011640f4 fffffff4 d08d0d20 d08e4fb0 d08ac037 d08d0d20 c047c000 d08cf6c0 c0378db8 c0378db8 00000000 d08cf820 ffffffed c047c000 00000000 c0255ab2 c047c000 d08cf6c0 Call Trace: [<d08ac037>] ivtv_probe+0x97/0xa00 [ivtv] [<c0255ab2>] pci_device_probe_static+0x52/0x70 [<c0255b0c>] __pci_device_probe+0x3c/0x50 [<c0255b4c>] pci_device_probe+0x2c/0x50 [<c0274d0f>] driver_probe_device+0x2f/0x80 [<c0274e5c>] driver_attach+0x5c/0xa0 [<c02753ad>] bus_add_driver+0x9d/0xd0 [<c02759cf>] driver_register+0x2f/0x40 [<c0255dc4>] pci_register_driver+0x64/0x90 [<d08ace7c>] module_start+0xcc/0x1f0 [ivtv] [<c01309f2>] sys_init_module+0x152/0x1e0 [<c0109040>] syscall_call+0x7/0xb Code: 8c d0 89 44 24 04 e8 4b d7 86 ef b8 01 00 00 00 89 87 ec 40 01 00 66 81 7b 26 89 31 75 c7 b8 02 00 00 00 89 87 ec 40 01 00 eb ba <a1> 24 00 00 00 eb 98 8d 74 26 00 8b 87 d8 00 00 00 89 44 24 0c I built the module with "make ARCH=xen", just like I do in domain 0. I found a solution to a similar problem here: http://forums.gentoo.org/viewtopic-t-259241-highlight-ivtv.html and that does let me load the driver successuflly. But once I try to capture some video using cat (after setting the card inputs and such), this happens: neptune ~ # cat /dev/video1 > test.mpg Assertion failure in journal_commit_transaction() at fs/jbd/commit.c:142: "commit_transaction->t_state == T_RUNNING" ------------[ cut here ]------------ kernel BUG at :54505! invalid operand: 0000 [#1] Modules linked in: msp3400 saa7115 tuner tveeprom ivtv i2c_algo_bit videodev ehci_hcd uhci_hcd usbcore CPU: 0 EIP: 0061:[<c019bcfa>] Not tainted VLI EFLAGS: 00010292 (2.6.11-xenU) EIP is at journal_commit_transaction+0xe8a/0xf20 eax: 00000078 ebx: c0315600 ecx: c033a8ac edx: fbffc000 esi: cd9bd280 edi: 1c025002 ebp: 00000000 esp: c132bde4 ds: 007b es: 007b ss: 0069 Process kjournald (pid: 108, threadinfo=c132b000 task=c130b020) Stack: c0312620 c02fffbc c030f212 0000008e c0315600 c132b000 00000000 00000000 00000000 00000000 00000000 cc6149bc cc614e3c 00000300 00000000 00000000 00000000 00000000 01c000e1 00000004 c043b001 00000001 00000000 fffffff4 Call Trace: [<c016893a>] d_rehash+0x4a/0x60 [<c010574d>] ctrl_if_send_message_noblock+0xad/0xe0 [<c010773a>] __switch_to+0x2a/0x390 [<c02f8cea>] schedule+0x2da/0x4d0 [<c03bb580>] kernel_param_sysfs_setup+0x10/0xc0 [<c01161ca>] __wake_up+0x3a/0x70 [<c019de4d>] kjournald+0xcd/0x1f0 [<c012ca20>] autoremove_wake_function+0x0/0x60 [<c012ca20>] autoremove_wake_function+0x0/0x60 [<c0108f22>] ret_from_fork+0x6/0x1c [<c019dd60>] commit_timeout+0x0/0x10 [<c019dd80>] kjournald+0x0/0x1f0 [<c01070c5>] kernel_thread_helper+0x5/0x10 Code: 31 c0 b9 8e 00 00 00 ba 12 f2 30 c0 89 4c 24 0c bb 00 56 31 c0 b8 bc ff 2f c0 89 5c 24 10 89 54 24 08 89 44 24 04 e8 56 d8 f7 ff <0f> 0b e9 d4 f1 ff ff c7 04 24 20 26 31 c0 b8 40 56 31 c0 bd bc <1>Unable to handle kernel paging request at virtual address b0eaae68 printing eip: c015d58c *pde = ma 00000000 pa 55555000 [<c02983f9>] sock_poll+0x29/0x40 [<c0163753>] do_select+0x243/0x2c0 [<c0163340>] __pollwait+0x0/0xd0 [<c0163aeb>] sys_select+0x2db/0x4f0 [<c0151578>] vfs_write+0xc8/0x130 [<c0109040>] syscall_call+0x7/0xb Oops: 0000 [#2] Modules linked in: msp3400 saa7115 tuner tveeprom ivtv i2c_algo_bit videodev ehci_hcd uhci_hcd usbcore CPU: 0 EIP: 0061:[<c015d58c>] Not tainted VLI EFLAGS: 00010246 (2.6.11-xenU) EIP is at pipe_poll+0x3c/0xc0 eax: ce42eb7c ebx: b0eaae60 ecx: 00000001 edx: 00000000 esi: cda9627c edi: ceb3b380 ebp: 00000005 esp: cf187ed4 ds: 007b es: 007b ss: 0069 Process sshd (pid: 5035, threadinfo=cf187000 task=ceb2f590) Stack: 00000008 00000003 c02983f9 ceb3b380 00000020 00000005 00000005 c0163753 ceb3b380 00000000 00000000 00000000 00000128 00000000 00000000 00000008 00000145 00000128 cf187000 cea3cb2c cea3cb28 cea3cb24 cea3cb34 cea3cb30 Call Trace: [<c02983f9>] sock_poll+0x29/0x40 [<c0163753>] do_select+0x243/0x2c0 [<c0163340>] __pollwait+0x0/0xd0 [<c0163aeb>] sys_select+0x2db/0x4f0 [<c0151578>] vfs_write+0xc8/0x130 [<c0109040>] syscall_call+0x7/0xb Code: 89 5c 24 0c 89 74 24 10 89 6c 24 18 8b 47 08 8b 70 08 8b 9e f0 00 00 00 74 11 85 db 74 0d 89 54 24 08 89 5c 24 04 89 3c 24 ff 12 <8b> 6b 08 31 c9 0f b7 5f 1c f6 c3 01 74 36 85 ed b8 41 00 00 00 <3>swap_free: Bad swap file entry 300b2300 swap_free: Bad swap file entry 80207c18 swap_free: Bad swap file entry 20081f06 swap_free: Bad swap offset entry 00095fc4 swap_free: Bad swap file entry 60163059 swap_free: Bad swap file entry 100410a0 Unable to handle kernel paging request at virtual address b981a171 printing eip: c0166ff0 *pde = ma 00000000 pa 55555000 [<c029767b>] sock_destroy_inode+0x1b/0x20 [<c01691bf>] destroy_inode+0x2f/0x50 [<c015235f>] __fput+0x9f/0x100 [<c0150b02>] filp_close+0x52/0x90 [<c011a874>] put_files_struct+0x64/0xd0 [<c011b46f>] do_exit+0xaf/0x2b0 [<c0119567>] printk+0x17/0x20 [<c010999d>] die+0x16d/0x170 [<c0109040>] syscall_call+0x7/0xb [<c0113138>] do_page_fault+0x318/0x693 [<c0137a05>] buffered_rmqueue+0x105/0x200 [<c0137e93>] __alloc_pages+0x2e3/0x420 [<c02f8cea>] schedule+0x2da/0x4d0 [<c01093ff>] page_fault+0x3b/0x40 [<c025007b>] send_tree+0x2b/0x610 [<c015d58c>] pipe_poll+0x3c/0xc0 [<c02983f9>] sock_poll+0x29/0x40 [<c0163753>] do_select+0x243/0x2c0 [<c0163340>] __pollwait+0x0/0xd0 [<c0163aeb>] sys_select+0x2db/0x4f0 [<c0151578>] vfs_write+0xc8/0x130 [<c0109040>] syscall_call+0x7/0xb Oops: 0000 [#3] Modules linked in: msp3400 saa7115 tuner tveeprom ivtv i2c_algo_bit videodev ehci_hcd uhci_hcd usbcore CPU: 0 EIP: 0061:[<c0166ff0>] Not tainted VLI EFLAGS: 00010282 (2.6.11-xenU) EIP is at locks_remove_posix+0x90/0x130 eax: 00000000 ebx: b981a149 ecx: ceb3b380 edx: c033d180 esi: cda96314 edi: cf500a80 ebp: 00000001 esp: cf187cc0 ds: 0069 es: 0069 ss: 0069 Process sshd (pid: 5035, threadinfo=cf187000 task=ceb2f590) Stack: c0153531 cf765524 cf765524 c043cc00 cf765524 cf765524 cf765524 c029767b cf500a80 000013ab c01691bf cf765524 ceb3b380 cf760201 00000000 00000000 ffffffff 7fffffff ce42e8d4 ceb3b180 00000000 00000000 c015235f ce42e8d4 Call Trace: [<c0153531>] invalidate_inode_buffers+0x11/0x60 [<c029767b>] sock_destroy_inode+0x1b/0x20 [<c01691bf>] destroy_inode+0x2f/0x50 [<c015235f>] __fput+0x9f/0x100 [<c0150b02>] filp_close+0x52/0x90 [<c011a874>] put_files_struct+0x64/0xd0 [<c011b46f>] do_exit+0xaf/0x2b0 [<c0119567>] printk+0x17/0x20 [<c010999d>] die+0x16d/0x170 [<c0109040>] syscall_call+0x7/0xb [<c0113138>] do_page_fault+0x318/0x693 [<c0137a05>] buffered_rmqueue+0x105/0x200 [<c0137e93>] __alloc_pages+0x2e3/0x420 [<c02f8cea>] schedule+0x2da/0x4d0 [<c01093ff>] page_fault+0x3b/0x40 [<c025007b>] send_tree+0x2b/0x610 [<c015d58c>] pipe_poll+0x3c/0xc0 [<c02983f9>] sock_poll+0x29/0x40 [<c0163753>] do_select+0x243/0x2c0 [<c0163340>] __pollwait+0x0/0xd0 [<c0163aeb>] sys_select+0x2db/0x4f0 [<c0151578>] vfs_write+0xc8/0x130 [<c0109040>] syscall_call+0<1>Unable to handle kernel paging request at virtual address 04cbae7e printing eip: c013ba92 *pde = ma 00000000 pa 55555000 [<c013c17a>] drain_array_locked+0x7a/0xc0 [<c013c22b>] cache_reap+0x6b/0x1b0 [<c013c1c0>] cache_reap+0x0/0x1b0 [<c0128574>] worker_thread+0x1d4/0x2b0 [<c0116100>] default_wake_function+0x0/0x20 [<c0116100>] default_wake_function+0x0/0x20 [<c01283a0>] worker_thread+0x0/0x2b0 [<c012c55a>] kthread+0xaa/0xb0 [<c012c4b0>] kthread+0x0/0xb0 [<c01070c5>] kernel_thread_helper+0x5/0x10 Oops: 0002 [#5] Modules linked in: msp3400 saa7115 tuner tveeprom ivtv i2c_algo_bit videodev ehci_hcd uhci_hcd usbcore CPU: 0 EIP: 0061:[<c013ba92>] Not tainted VLI EFLAGS: 00010206 (2.6.11-xenU) EIP is at free_block+0x52/0xe0 eax: 04cbae7a ebx: cda96000 ecx: cda96158 edx: 0c3fff5c esi: c1279a80 edi: 00000000 ebp: 00000002 esp: c043eeec ds: 007b es: 007b ss: 0069 Process events/0 (pid: 3, threadinfo=c043e000 task=c126d020) Stack: c043ef08 c0115518 c1279a9c c127dc90 c127dc80 00000002 c1279a80 c013c17a c1279a80 c127dc90 00000002 c127999c c1279a80 00000001 c1279af0 c013c22b c1279a80 c127dc80 00000000 c127999c c126d170 00000000 00000000 c03ddea0 Call Trace: [<c0115518>] recalc_task_prio+0x88/0x150 [<c013c17a>] drain_array_locked+0x7a/0xc0 [<c013c22b>] cache_reap+0x6b/0x1b0 [<c013c1c0>] cache_reap+0x0/0x1b0 [<c0128574>] worker_thread+0x1d4/0x2b0 [<c0116100>] default_wake_function+0x0/0x20 [<c0116100>] default_wake_function+0x0/0x20 [<c01283a0>] worker_thread+0x0/0x2b0 [<c012c55a>] kthread+0xaa/0xb0 [<c012c4b0>] kthread+0x0/0xb0 [<c01070c5>] kernel_thread_helper+0x5/0x10 Code: 00 00 8d bc 27 00 00 00 00 8b 44 24 24 8b 15 b0 df 3d c0 8b 0c b8 8d 81 00 00 00 40 c1 e8 0c c1 e0 05 8b 5c 02 1c 8b 53 04 8b 03 <89> 50 04 89 02 8b 43 0c 31 d2 c7 03 00 01 10 00 c7 43 04 00 02 <1>Unable to handle kernel paging request at virtual address a2ba40a4 printing eip: c013b924 *pde = ma 00000000 pa 55555000 [<c013bc49>] kmem_cache_alloc+0x69/0x70 [<d08b517f>] ivtv_init_buffer+0x1f/0x1f0 [ivtv] [<d08b6730>] gather_free_buffers+0x2a0/0x2d0 [ivtv] [<d08b7aeb>] ivtv_api_getresult_nosleep+0x5b/0x90 [ivtv] [<d08b6ae6>] ivtv_sched_DMA+0x386/0xbb0 [ivtv] [<c0116100>] default_wake_function+0x0/0x20 [<c0116161>] __wake_up_common+0x41/0x70 [<c0116100>] default_wake_function+0x0/0x20 [<c01161ca>] __wake_up+0x3a/0x70 [<d08b9fae>] enc_work_handler+0x8e/0x90 [ivtv] [<d08bb69d>] ivtv_enc_thread+0x14d/0x1e2 [ivtv] [<c012ca20>] autoremove_wake_function+0x0/0x60 [<c0115ae7>] schedule_tail+0x17/0x50 [<c012ca20>] autoremove_wake_function+0x0/0x60 [<d08bb550>] ivtv_enc_thread+0x0/0x1e2 [ivtv] [<d08bb550>] ivtv_enc_thread+0x0/0x1e2 [ivtv] [<c01070c5>] kernel_thread_helper+0x5/0x10 Oops: 0002 [#6] Modules linked in: msp3400 saa7115 tuner tveeprom ivtv i2c_algo_bit videodev ehci_hcd uhci_hcd usbcore CPU: 0 EIP: 0061:[<c013b924>] Not tainted VLI EFLAGS: 00010212 (2.6.11-xenU) EIP is at cache_alloc_refill+0xd4/0x1f0 eax: a2ba40a0 ebx: c127c800 ecx: cd9bd000 edx: c043328c esi: 00000036 edi: c0433280 ebp: c127c810 esp: ce4e5de8 ds: 007b es: 007b ss: 0069 Process ivtv-enc (pid: 4852, threadinfo=ce4e5000 task=ceb65a00) Stack: c0433980 c03bbd00 ffffffff cf1ec018 c043328c c0433294 00000000 ce5da800 ce5da800 ce4e5ed0 c013bc49 c0433280 000000d0 000000d0 ce5da800 d08b517f c0433280 000000d0 00000000 00000000 d08b6730 d08e4fb0 ce5da800 00000003 Call Trace: [<c03bbd00>] __alloc_bootmem_core+0xf0/0x350 [<c013bc49>] kmem_cache_alloc+0x69/0x70 [<d08b517f>] ivtv_init_buffer+0x1f/0x1f0 [ivtv] [<d08b6730>] gather_free_buffers+0x2a0/0x2d0 [ivtv] [<d08b7aeb>] ivtv_api_getresult_nosleep+0x5b/0x90 [ivtv] [<d08b6ae6>] ivtv_sched_DMA+0x386/0xbb0 [ivtv] [<c0116100>] default_wake_function+0x0/0x20 [<c0116161>] __wake_up_common+0x41/0x70 [<c0116100>] default_wake_function+0x0/0x20 [<c01161ca>] __wake_up+0x3a/0x70 [<d08b9fae>] enc_work_handler+0x8e/0x90 [ivtv] [<d08bb69d>] ivtv_enc_thread+0x14d/0x1e2 [ivtv] [<c012ca20>] autoremove_wake_function+0x0/0x60 [<c0115ae7>] schedule_tail+0x17/0x50 [<c012ca20>] autoremove_wake_function+0x0/0x60 [<d08bb550>] ivtv_enc_thread+0x0/0x1e2 [ivtv] [<d08bb550>] ivtv_enc_thread+0x0/0x1e2 [ivtv] [<c01070c5>] kernel_thread_helper+0x5/0x10 Code: 8b 51 10 0f b7 41 14 42 89 51 10 8b 7c 24 0c 0f b7 04 47 66 89 41 14 8b 44 24 2c 3b 50 3c 73 06 4e 83 fe ff 75 c1 8b 51 04 8b 01 <89> 50 04 89 02 66 83 79 14 ff c7 01 00 01 10 00 c7 41 04 00 02 <1>Unable to handle kernel paging request at virtual address e1ca80ef printing eip: c013b924 *pde = ma 00000000 pa 55555000 [<c013bc49>] kmem_cache_alloc+0x69/0x70 At that point the whole box reboots. Any help would be appreciated, I''ve been battling this for a few days and am not making any progress. Thanks, Dave -- David Muench - davemuench@gmail.com Jabber ID: dave@jabber.wasteland.org _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2005-Jul-03 22:06 UTC
Re: [Xen-devel] Oops when modprobing ivtv outside of dom0
On 3 Jul 2005, at 20:54, David Muench wrote:> At that point the whole box reboots. > > Any help would be appreciated, I''ve been battling this for a few days > and am not making any progress.One possibility is that the driver is depending on contiguous physical memory, and domain0 usually happens to get that (but domUs generally will get fragmented physical memory). You could confirm this by making a debug build of Xen (debug=y make) which deliberately jumbles the physical memory map for domain0. It''s quite possible that this will then cause the driver to fail on dom0 too. If we can diagnose that this is the problem, it probably won''t take much to fix the driver. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
David Muench
2005-Jul-04 00:04 UTC
Re: [Xen-devel] Oops when modprobing ivtv outside of dom0
Hi Keir, I think you''re on to something there. I compiled a debug version of xen (all I needed was a debug version of xen.gz, right?) and while the ivtv modules loaded without any complaints, as soon as I started capturing video there were a series of panics and the box went into a semi-hung state. I''m back in my non debug xen now and everything is working perfectly again in dom0. Thanks very much, Dave On 7/3/05, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote:> > On 3 Jul 2005, at 20:54, David Muench wrote: > > > At that point the whole box reboots. > > > > Any help would be appreciated, I''ve been battling this for a few days > > and am not making any progress. > > One possibility is that the driver is depending on contiguous physical > memory, and domain0 usually happens to get that (but domUs generally > will get fragmented physical memory). You could confirm this by making > a debug build of Xen (debug=y make) which deliberately jumbles the > physical memory map for domain0. It''s quite possible that this will > then cause the driver to fail on dom0 too. If we can diagnose that this > is the problem, it probably won''t take much to fix the driver. > > -- Keir > >-- David Muench - davemuench@gmail.com Jabber ID: dave@jabber.wasteland.org _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2005-Jul-04 06:29 UTC
Re: [Xen-devel] Oops when modprobing ivtv outside of dom0
On 4 Jul 2005, at 01:04, David Muench wrote:> I think you''re on to something there. I compiled a debug version of > xen (all I needed was a debug version of xen.gz, right?) and while the > ivtv modules loaded without any complaints, as soon as I started > capturing video there were a series of panics and the box went into a > semi-hung state. I''m back in my non debug xen now and everything is > working perfectly again in dom0.I''ll pull down the driver and take a look. Have you tried using their latest ''unstable'' driver (v0.3.3k)? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
David Muench
2005-Jul-04 12:26 UTC
Re: [Xen-devel] Oops when modprobing ivtv outside of dom0
Thanks, I really appreciate it. I have tried the unstable driver - it loads, but it goes through each of the 3 cards and says something like "Can''t find PCI slot", and "Error -6". I can get you exact error messages from the unstable driver if it would help. Dave On 7/4/05, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote:> > On 4 Jul 2005, at 01:04, David Muench wrote: > > > I think you''re on to something there. I compiled a debug version of > > xen (all I needed was a debug version of xen.gz, right?) and while the > > ivtv modules loaded without any complaints, as soon as I started > > capturing video there were a series of panics and the box went into a > > semi-hung state. I''m back in my non debug xen now and everything is > > working perfectly again in dom0. > > I''ll pull down the driver and take a look. Have you tried using their > latest ''unstable'' driver (v0.3.3k)? > > -- Keir > >-- David Muench - davemuench@gmail.com Jabber ID: dave@jabber.wasteland.org _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2005-Jul-04 12:57 UTC
Re: [Xen-devel] Oops when modprobing ivtv outside of dom0
On 4 Jul 2005, at 13:26, David Muench wrote:> Thanks, I really appreciate it. I have tried the unstable driver - it > loads, but it goes through each of the 3 cards and says something like > "Can''t find PCI slot", and "Error -6". I can get you exact error > messages from the unstable driver if it would help.The driver is *really* big, so we''ll need to narrow this down some more. It''s probably best to do this in domU, as there the driver was crashing nice and early while probing for the card. The dom0 crash is going to be harder to track down, and hopefully fixing domU will fix dom0. You can get a lot more debug info out of the driver by specifying the argument ''ivtv_debug=255'' when you install the module. This will make the very verbose indeed, but should narrow the crash down to within a few lines of code. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
David Muench
2005-Jul-04 14:04 UTC
Re: [Xen-devel] Oops when modprobing ivtv outside of dom0
Here''s the output with ivtv_debug=255 specified. It''s not a lot more output, it looks to be crashing pretty early: Linux video capture interface: v1.00 ivtv: ==================== START INIT IVTV ===================ivtv: version 0.2.0 (rc3j) loading ivtv: Linux version: 2.6.11-xenU PENTIUM4 4KSTACKS gcc-3.3 ivtv: In case of problems please include the debug info ivtv: between the START INIT IVTV and END INIT IVTV lines when ivtv: mailing the ivtv-devel mailinglist. ivtv: ... running on kernel 2.6.11-xenU ivtv: Setting some variables to invalid for detection ivtv: Scanning PCI bus.. ivtv: Found card #0 ivtv: Autodetected WinTV PVR 250 card ivtv: Found an iTVC15 based chip ivtv: base addr: 0xe4000000 ivtv: Enabling pci device PCI: Obtained IRQ 22 for device 0000:02:01.0 ivtv: Bus Mastering Enabled.<6>ivtv: Unreasonably low latency timer, setting to 64 (was 32) ivtv: 2051 (rev 1) at 02:01.0, ivtv: irq: 22, latency: 64, memory: 0xe4000000 Unable to handle kernel NULL pointer dereference at virtual address 00000024 printing eip: d08abe25 *pde = ma 00000000 pa 55555000 [<d08ac037>] ivtv_probe+0x97/0xa00 [ivtv] [<c0255ab2>] pci_device_probe_static+0x52/0x70 [<c0255b0c>] __pci_device_probe+0x3c/0x50 [<c0255b4c>] pci_device_probe+0x2c/0x50 [<c0274d0f>] driver_probe_device+0x2f/0x80 [<c0274e5c>] driver_attach+0x5c/0xa0 [<c02753ad>] bus_add_driver+0x9d/0xd0 [<c02759cf>] driver_register+0x2f/0x40 [<c0255dc4>] pci_register_driver+0x64/0x90 [<d08ace7c>] module_start+0xcc/0x1f0 [ivtv] [<c01309f2>] sys_init_module+0x152/0x1e0 [<c0109040>] syscall_call+0x7/0xb Oops: 0000 [#1] Modules linked in: ivtv i2c_algo_bit videodev ehci_hcd uhci_hcd usbcore CPU: 0 EIP: 0061:[<d08abe25>] Not tainted VLI EFLAGS: 00010246 (2.6.11-xenU) EIP is at ivtv_setup_pci+0x1e5/0x360 [ivtv] eax: 00000000 ebx: 00000000 ecx: 00000000 edx: 00000000 esi: c047c000 edi: d08d0d20 ebp: c047c000 esp: ce4cce84 ds: 007b es: 007b ss: 0069 Process modprobe (pid: 5057, threadinfo=ce4cc000 task=ce835a80) Stack: 00000000 00000000 00000040 e4000000 00000001 00000000 011640b0 fffffff4 d08d0d20 d08e4fb0 d08ac037 d08d0d20 c047c000 d08cf6c0 c0378db8 c0378db8 00000000 d08cf820 ffffffed c047c000 00000000 c0255ab2 c047c000 d08cf6c0 Call Trace: [<d08ac037>] ivtv_probe+0x97/0xa00 [ivtv] [<c0255ab2>] pci_device_probe_static+0x52/0x70 [<c0255b0c>] __pci_device_probe+0x3c/0x50 [<c0255b4c>] pci_device_probe+0x2c/0x50 [<c0274d0f>] driver_probe_device+0x2f/0x80 [<c0274e5c>] driver_attach+0x5c/0xa0 [<c02753ad>] bus_add_driver+0x9d/0xd0 [<c02759cf>] driver_register+0x2f/0x40 [<c0255dc4>] pci_register_driver+0x64/0x90 [<d08ace7c>] module_start+0xcc/0x1f0 [ivtv] [<c01309f2>] sys_init_module+0x152/0x1e0 [<c0109040>] syscall_call+0x7/0xb Code: 8c d0 89 44 24 04 e8 4b d7 86 ef b8 01 00 00 00 89 87 ec 40 01 00 66 81 7b 26 89 31 75 c7 b8 02 00 00 00 89 87 ec 40 01 00 eb ba <a1> 24 00 00 00 eb 98 8d 74 26 00 8b 87 d8 00 00 00 89 44 24 0c Thanks again. BTW, I''ve tried only presenting one of the TV cards to the domU (and I''ve tried each of the 3 by itself in turn), that doesn''t make any difference. Dave On 7/4/05, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote:> > On 4 Jul 2005, at 13:26, David Muench wrote: > > > Thanks, I really appreciate it. I have tried the unstable driver - it > > loads, but it goes through each of the 3 cards and says something like > > "Can''t find PCI slot", and "Error -6". I can get you exact error > > messages from the unstable driver if it would help. > > The driver is *really* big, so we''ll need to narrow this down some > more. It''s probably best to do this in domU, as there the driver was > crashing nice and early while probing for the card. The dom0 crash is > going to be harder to track down, and hopefully fixing domU will fix > dom0. > > You can get a lot more debug info out of the driver by specifying the > argument ''ivtv_debug=255'' when you install the module. This will make > the very verbose indeed, but should narrow the crash down to within a > few lines of code. > > -- Keir > >-- David Muench - davemuench@gmail.com Jabber ID: dave@jabber.wasteland.org _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
David Muench
2005-Jul-04 14:17 UTC
Re: [Xen-devel] Oops when modprobing ivtv outside of dom0
By the way, here''s what the start of a successful ivtv load in dom0 looks like: ivtv: ==================== START INIT IVTV ===================ivtv: version 0.2.0 (rc3j) loading ivtv: Linux version: 2.6.11.10-xen0 PENTIUM4 4KSTACKS gcc-3.3 ivtv: In case of problems please include the debug info ivtv: between the START INIT IVTV and END INIT IVTV lines when ivtv: mailing the ivtv-devel mailinglist. ivtv: Autodetected WinTV PVR 250 card ivtv: Found an iTVC15 based chip PCI: Obtained IRQ 22 for device 0000:02:01.0 ivtv: Unreasonably low latency timer, setting to 64 (was 32) ivtv: XXX PCI device: 0x2570 vendor: 0x8086 ivtv: i2c attach [client=tveeprom,ok] And it goes on and on from there. I''m pretty sure it''s crashing on that "XXX PCI device" line, which is line 676 in driver/ivtv-driver.c. But since I''m not a kernel coder, I have no real clue why. My best guess would be that something bad is happening with that pci_find_slot call. The if statement that line 676 is a part of is probably to implement some workarounds if you have a VIA chipset motherboard - the ivtv cards bring out the bugginess in some of the older VIA motherboards, leading to instability. I''m using an Intel motherboard though. Dave On 7/4/05, David Muench <davemuench@gmail.com> wrote:> Here''s the output with ivtv_debug=255 specified. It''s not a lot more > output, it looks to be crashing pretty early: > > Linux video capture interface: v1.00 > ivtv: ==================== START INIT IVTV ===================> ivtv: version 0.2.0 (rc3j) loading > ivtv: Linux version: 2.6.11-xenU PENTIUM4 4KSTACKS gcc-3.3 > ivtv: In case of problems please include the debug info > ivtv: between the START INIT IVTV and END INIT IVTV lines when > ivtv: mailing the ivtv-devel mailinglist. > ivtv: ... running on kernel 2.6.11-xenU > ivtv: Setting some variables to invalid for detection > ivtv: Scanning PCI bus.. > ivtv: Found card #0 > ivtv: Autodetected WinTV PVR 250 card > ivtv: Found an iTVC15 based chip > ivtv: base addr: 0xe4000000 > ivtv: Enabling pci device > PCI: Obtained IRQ 22 for device 0000:02:01.0 > ivtv: Bus Mastering Enabled.<6>ivtv: Unreasonably low latency timer, > setting to 64 (was 32) > ivtv: 2051 (rev 1) at 02:01.0, ivtv: irq: 22, latency: 64, > memory: 0xe4000000 > Unable to handle kernel NULL pointer dereference at virtual address 00000024 > printing eip: > d08abe25 > *pde = ma 00000000 pa 55555000 > [<d08ac037>] ivtv_probe+0x97/0xa00 [ivtv] > [<c0255ab2>] pci_device_probe_static+0x52/0x70 > [<c0255b0c>] __pci_device_probe+0x3c/0x50 > [<c0255b4c>] pci_device_probe+0x2c/0x50 > [<c0274d0f>] driver_probe_device+0x2f/0x80 > [<c0274e5c>] driver_attach+0x5c/0xa0 > [<c02753ad>] bus_add_driver+0x9d/0xd0 > [<c02759cf>] driver_register+0x2f/0x40 > [<c0255dc4>] pci_register_driver+0x64/0x90 > [<d08ace7c>] module_start+0xcc/0x1f0 [ivtv] > [<c01309f2>] sys_init_module+0x152/0x1e0 > [<c0109040>] syscall_call+0x7/0xb > Oops: 0000 [#1] > Modules linked in: ivtv i2c_algo_bit videodev ehci_hcd uhci_hcd usbcore > CPU: 0 > EIP: 0061:[<d08abe25>] Not tainted VLI > EFLAGS: 00010246 (2.6.11-xenU) > EIP is at ivtv_setup_pci+0x1e5/0x360 [ivtv] > eax: 00000000 ebx: 00000000 ecx: 00000000 edx: 00000000 > esi: c047c000 edi: d08d0d20 ebp: c047c000 esp: ce4cce84 > ds: 007b es: 007b ss: 0069 > Process modprobe (pid: 5057, threadinfo=ce4cc000 task=ce835a80) > Stack: 00000000 00000000 00000040 e4000000 00000001 00000000 011640b0 fffffff4 > d08d0d20 d08e4fb0 d08ac037 d08d0d20 c047c000 d08cf6c0 c0378db8 c0378db8 > 00000000 d08cf820 ffffffed c047c000 00000000 c0255ab2 c047c000 d08cf6c0 > Call Trace: > [<d08ac037>] ivtv_probe+0x97/0xa00 [ivtv] > [<c0255ab2>] pci_device_probe_static+0x52/0x70 > [<c0255b0c>] __pci_device_probe+0x3c/0x50 > [<c0255b4c>] pci_device_probe+0x2c/0x50 > [<c0274d0f>] driver_probe_device+0x2f/0x80 > [<c0274e5c>] driver_attach+0x5c/0xa0 > [<c02753ad>] bus_add_driver+0x9d/0xd0 > [<c02759cf>] driver_register+0x2f/0x40 > [<c0255dc4>] pci_register_driver+0x64/0x90 > [<d08ace7c>] module_start+0xcc/0x1f0 [ivtv] > [<c01309f2>] sys_init_module+0x152/0x1e0 > [<c0109040>] syscall_call+0x7/0xb > Code: 8c d0 89 44 24 04 e8 4b d7 86 ef b8 01 00 00 00 89 87 ec 40 01 > 00 66 81 7b 26 89 31 75 c7 b8 02 00 00 00 89 87 ec 40 01 00 eb ba <a1> > 24 00 00 00 eb 98 8d 74 26 00 8b 87 d8 00 00 00 89 44 24 0c > > Thanks again. BTW, I''ve tried only presenting one of the TV cards to > the domU (and I''ve tried each of the 3 by itself in turn), that > doesn''t make any difference. > > Dave > > On 7/4/05, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote: > > > > On 4 Jul 2005, at 13:26, David Muench wrote: > > > > > Thanks, I really appreciate it. I have tried the unstable driver - it > > > loads, but it goes through each of the 3 cards and says something like > > > "Can''t find PCI slot", and "Error -6". I can get you exact error > > > messages from the unstable driver if it would help. > > > > The driver is *really* big, so we''ll need to narrow this down some > > more. It''s probably best to do this in domU, as there the driver was > > crashing nice and early while probing for the card. The dom0 crash is > > going to be harder to track down, and hopefully fixing domU will fix > > dom0. > > > > You can get a lot more debug info out of the driver by specifying the > > argument ''ivtv_debug=255'' when you install the module. This will make > > the very verbose indeed, but should narrow the crash down to within a > > few lines of code. > > > > -- Keir > > > > > > > -- > David Muench - davemuench@gmail.com > Jabber ID: dave@jabber.wasteland.org >-- David Muench - davemuench@gmail.com Jabber ID: dave@jabber.wasteland.org _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2005-Jul-04 15:37 UTC
Re: [Xen-devel] Oops when modprobing ivtv outside of dom0
On 4 Jul 2005, at 15:04, David Muench wrote:> Here''s the output with ivtv_debug=255 specified. It''s not a lot more > output, it looks to be crashing pretty early:That''s weird. It''s crashing somewhere in ivtv_probe(), yet one of the first things that function does is print a line of debug output. But that output hasn;t appeared in your trace. :-/ Maybe try adding an explicit printk at the start of ivtv_probe and see if that appears: printk(KERN_ALERT "**********\n"); Also, perhaps you can make available for download somewhere your kernel module image corresponding to the crash dump? Then maybe I can look inside it to find out where in ivtv_probe() it is actually crashing. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2005-Jul-05 06:46 UTC
Re: [Xen-devel] Oops when modprobing ivtv outside of dom0
> On 7/4/05, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote: > > > That''s weird. It''s crashing somewhere in ivtv_probe(), yet one of the > > first things that function does is print a line of debug output. But > > that output hasn;t appeared in your trace. :-/ > > > > Maybe try adding an explicit printk at the start of ivtv_probe and see > > if that appears: > > printk(KERN_ALERT "**********\n"); > > You mean the "Found card #" message? That did show up on the one that > I modprobe''d with ivtv_debug=255. > > Here''s the dmesg output with the printk added, and with ivtv_debug=255:Ah, I see the bug. It''s in both 2.0 and 3.3 (the unstable version) so it''s worth pointing out to the developers. The following code in ivtv_setup_pci() is broken: if (pci_bus != NULL && pci_bus->vendor == PCI_VENDOR_ID_VIA) { .... } else IVTV_KERN_INFO("XXX PCI device: 0x%04x vendor: 0x%04x\n", pci_bus->device, pci_bus->vendor); The else clause should be ''else if (pci_bus != NULL)''. Otherwise the debug IVTV_KERN_INFO line crashes trying to dereference a NULL pointer. :-) Actually, I think maybe they could get rid of that entire block of code -- nothing seems to depend on via_fix, which is the variable that it sets up. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
David Muench
2005-Jul-05 21:28 UTC
Re: [Xen-devel] Oops when modprobing ivtv outside of dom0
On 7/5/05, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote:> Ah, I see the bug. It''s in both 2.0 and 3.3 (the unstable version) so > it''s worth pointing out to the developers. The following code in > ivtv_setup_pci() is broken:Thanks, that fixed the loading problem, it now detects all the cards properly. However, when I try to read some video from the card (you can just cat /dev/video0 > file.mpg) it crashes the entire domU: neptune ~ # cat /dev/video0 > test.mpg Oops: 0000 [#1] Modules linked in: msp3400 saa7115 tuner tveeprom ivtv i2c_algo_bit videodev ehci_hcd uhci_hcd usbcore CPU: 0 EIP: 0061:[<b6f92126>] Not tainted VLI EFLAGS: 00010282 (2.6.11-xenU) EIP is at 0xb6f92126 eax: d08cfbc0 ebx: 00001000 ecx: 0007dfc0 edx: cbbe3fac esi: 00000000 edi: c0792c80 ebp: 0804d080 esp: cbbe3f74 ds: 007b es: 007b ss: 0069 Process cat (pid: 5522, threadinfo=cbbe3000 task=cdf7da00) Stack: c015133e c0792c80 0804d080 00001000 cbbe3fac c0792c80 fffffff7 0804d080 cbbe3000 c0151631 c0792c80 0804d080 00001000 cbbe3fac 0007dfc0 00000000 00000000 00000003 fbffc000 c0109040 00000003 0804d080 00001000 00001000 Call Trace: [<c015133e>] vfs_read+0xae/0x130 [<c0151631>] sys_read+0x51/0x80 [<c0109040>] syscall_call+0x7/0xb Code: Bad EIP value. <1>Unable to handle kernel paging request at virtual address 761853ac printing eip: 761853ac *pde = ma 00000000 pa 55555000 [<c011a874>] put_files_struct+0x64/0xd0 [<c011b46f>] do_exit+0xaf/0x2b0 [<c0110069>] sys_ptrace+0x89/0x610 [<c010999d>] die+0x16d/0x170 [<c0109040>] syscall_call+0x7/0xb [<c0113138>] do_page_fault+0x318/0x693 [<c0187994>] ext3_file_write+0x44/0xd0 [<c0151477>] do_sync_write+0xb7/0xf0 [<c01093ff>] page_fault+0x3b/0x40 [<c015133e>] vfs_read+0xae/0x130 [<c0151631>] sys_read+0x51/0x80 [<c0109040>] syscall_call+0x7/0xb Oops: 0000 [#2] Modules linked in: msp3400 saa7115 tuner tveeprom ivtv i2c_algo_bit videodev ehci_hcd uhci_hcd usbcore CPU: 0 EIP: 0061:[<761853ac>] Not tainted VLI EFLAGS: 00010206 (2.6.11-xenU) EIP is at 0x761853ac eax: d08cfbc0 ebx: c0792c80 ecx: c08e3780 edx: 761853ac esi: 00000000 edi: cfb8a680 ebp: 00000001 esp: cbbe3dd4 ds: 0069 es: 0069 ss: 0069 Process cat (pid: 5522, threadinfo=cbbe3000 task=cdf7da00) Stack: c0150b26 c0792c80 cfb8a680 00000001 00000003 cfb8a680 c011a874 c0792c80 cfb8a680 cbbe3000 cdf7da00 0000000b 00000001 c011b46f cdf7da00 00000069 c0110069 00000012 cbbe3000 00000000 00000000 c078b22c c010999d 00000000 Call Trace: [<c0150b26>] filp_close+0x76/0x90 [<c011a874>] put_files_struct+0x64/0xd0 [<c011b46f>] do_exit+0xaf/0x2b0 [<c0110069>] sys_ptrace+0x89/0x610 [<c010999d>] die+0x16d/0x170 [<c0109040>] syscall_call+0x7/0xb [<c0113138>] do_page_fault+0x318/0x693 [<c0187994>] ext3_file_write+0x44/0xd0 [<c0151477>] do_sync_write+0xb7/0xf0 [<c01093ff>] page_fault+0x3b/0x40 [<c015133e>] vfs_read+0xae/0x130 [<c0151631>] sys_read+0x51/0x80 [<c0109040>] syscall_call+0x7/0xb Code: Bad EIP value. Segmentation fault neptune ~ # ************ REMOTE CONSOLE EXITED ***************** Any ideas on that one? :) If we''re getting out of the realm of Xen and I should go ask the IVTV guys, please don''t hesitate to say so. I just tried a second time, and it took a few tries of capturing video to crash it. But even when it didn''t crash, all I got was a zero byte file. I noticed the card was using interrupts (looking at /proc/interrupts), and things looked ok in dmesg, but no mpeg data. That time the domU didn''t exit on it''s own, but was pretty well hung up (non-responsive other than line feeds on the console). So I tried to xm destroy it, and that rebooted the entire box. Thanks, Dave -- David Muench - davemuench@gmail.com Jabber ID: dave@jabber.wasteland.org _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2005-Jul-06 08:45 UTC
Re: [Xen-devel] Oops when modprobing ivtv outside of dom0
On 5 Jul 2005, at 22:28, David Muench wrote:> I just tried a second time, and it took a few tries of capturing video > to crash it. But even when it didn''t crash, all I got was a zero byte > file. I noticed the card was using interrupts (looking at > /proc/interrupts), and things looked ok in dmesg, but no mpeg data. > That time the domU didn''t exit on it''s own, but was pretty well hung > up (non-responsive other than line feeds on the console). So I tried > to xm destroy it, and that rebooted the entire box.I think the ivtv driver is probably not calculating dma addresses in the way that xen requires. On native Linux, if you allocate a multi-page chunk of physical memory, you can pass the start address of that buffer to hardware and it can dma the entire buffer given just that address. In Xen, because we give guests ''pseudo-physical'' memory, that physical buffer may not be really physically contiguous. So we need drivers to dma_alloc_coherent or pci_alloc_consistent the memory they will use for dma --- we modified those functions to ensure they return suitable contiguous physical memory. Perhaps the developers may know where to look further. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
David Muench
2005-Jul-06 15:20 UTC
Re: [Xen-devel] Oops when modprobing ivtv outside of dom0
On 7/6/05, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote:> I think the ivtv driver is probably not calculating dma addresses in > the way that xen requires. On native Linux, if you allocate a > multi-page chunk of physical memory, you can pass the start address of > that buffer to hardware and it can dma the entire buffer given just > that address. In Xen, because we give guests ''pseudo-physical'' memory, > that physical buffer may not be really physically contiguous. So we > need drivers to dma_alloc_coherent or pci_alloc_consistent the memory > they will use for dma --- we modified those functions to ensure they > return suitable contiguous physical memory. > > Perhaps the developers may know where to look further.Thanks very much for all your help Keir, I''ve posted to the IVTV-Devel list and hopefully someone there can help me with the rest. Dave -- David Muench - davemuench@gmail.com Jabber ID: dave@jabber.wasteland.org _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel