On Fri, Jan 23, 2009 at 7:56 AM, Németh Márton <nm...@freemail.hu> wrote: > > To Markus: Hello Markus, could you please check this "dmesg" trace? I wrote > my analysis, but I > have some problems proposing a possible solution. > > ogre5000 wrote: >> Hello, >> >> Am 22.01.2009 um 07:34 schrieb Németh Márton: >>> I couldn't really find a simple testcase which triggers this problem, but >>> I analysed the source code and found that the function prototype >>> "v4l2_kioctl" >>> changed between Linux kernel 2.6.27 and 2.6.28: the inode parameter >>> was removed. >>> >>> Last time when I updated the em28xx-new I forget this fact. I just sent a >>> patch titled "[PATCH] remove inode parameter of typedef v4l2_kioctl as >>> of 2.6.28". >>> Could you please apply and test the new version of em28xx-new driver? >>>> >>> Here we can see that "(null)" is written to the output instead of a >>> readable >>> input and norm parameter. This usually signals that there might be >>> some return >>> value check missing in the code. >>> >>> This mmap2() calls also do not look like very good: -1 is the fd >>> parameter which >>> shall be positive. The -1 is an error code which comes from a previous >>> system call >>> and it is not a valid file descriptor. >> >> What can I do against it? I installed the latest release with this patch > > I don't know, yet what can you do against this -1 file descriptor. > >> applied. This didn't change anything. But notice that I have Kernel >> 2.6.27.7-9 anyway, not 2.6.28.x. > > There are changes in the dmesg, now you get a different error message, > so at least one problem is fixed, I think. > >> Here you see dmesg (interesting lines cut out) again with the new patch >> applied. First after trying "ZoneMinder" > >> em28xx v4l2 driver version 0.0.1 loaded >> em28xx: new video device (eb1a:2800): interface 0, class 255 >> em28xx: device is attached to a USB 2.0 bus >> em28xx #0: Alternate settings: 4 >> em28xx #0: Alternate setting 0, max size= 0 >> em28xx #0: Alternate setting 1, max size= 644 >> em28xx #0: Alternate setting 2, max size= 1288 >> em28xx #0: Alternate setting 3, max size= 2580 >> saa7115' 1-0025: saa7113 found (1f7113d0e100000) @ 0x4a (em28xx #0) >> attach_inform: saa7113 detected. >> em28xx #0: V4L2 device registered as /dev/video1 >> em28xx #0: Found Terratec Cinergy 200 USB >> usbcore: registered new interface driver em28xx >> >> The following is only an harmless informational message. >> Unless you get a _continuous_flood_ of these messages it means >> everything is working fine. Allocations from irqs cannot be >> perfectly reliable and the kernel is designed to handle that. >> zmc: page allocation failure. order:6, mode:0x0, alloc_flags:0x5, >> pflags:0x402000 >> Pid: 3313, comm: zmc Tainted: G D 2.6.27.7-debug2 #2 >> [<c01065d4>] dump_trace+0x63/0x227 >> [<c010702b>] show_trace+0x15/0x29 >> [<c0348341>] dump_stack+0x5b/0x65 >> [<c0177f2b>] __alloc_pages_internal+0x38b/0x3a2 >> [<c01087bf>] dma_alloc_pages+0x51/0x59 >> [<c0108889>] dma_alloc_coherent+0xc2/0x24e >> [<e1053375>] hcd_buffer_alloc+0x65/0x6d [usbcore] >> [<e104729f>] usb_buffer_alloc+0x16/0x1d [usbcore] >> [<e1aa47de>] em28xx_init_isoc+0x9b/0x19c [em28xx] >> [<e1aa1063>] em28xx_v4l2_open+0x46d/0x516 [em28xx] >> [<e10d919c>] video_open+0xcc/0x12b [videodev] >> [<c01a185b>] chrdev_open+0x13b/0x152 >> [<c019dc57>] __dentry_open+0x10f/0x1fd >> [<c019ddcc>] nameidata_to_filp+0x1f/0x33 >> [<c01a914c>] do_filp_open+0x33c/0x65b >> [<c019da6e>] do_sys_open+0x42/0xbd >> [<c019db2b>] sys_open+0x1e/0x26 >> [<c0104bdb>] sysenter_do_call+0x12/0x3f >> [<ffffe430>] 0xffffe430 >> ======================= >> Mem-Info: >> Node 0 DMA per-cpu: >> CPU 0: hi: 0, btch: 1 usd: 0 >> Node 0 Normal per-cpu: >> CPU 0: hi: 186, btch: 31 usd: 86 >> Active:52879 inactive:50696 dirty:84 writeback:0 unstable:0 >> free:1081 slab:8988 mapped:17111 pagetables:409 bounce:0 >> Node 0 DMA free:2028kB min:88kB low:108kB high:132kB active:1296kB >> inactive:2252kB present:15708kB pages_scanned:32 all_unreclaimable? no >> lowmem_reserve[]: 0 481 481 481 >> Node 0 Normal free:2296kB min:2760kB low:3448kB high:4140kB active:210220kB >> inactive:200532kB present:492704kB pages_scanned:0 all_unreclaimable? no >> lowmem_reserve[]: 0 0 0 0 >> Node 0 DMA: 7*4kB 0*8kB 1*16kB 0*32kB 1*64kB 1*128kB 1*256kB 1*512kB >> 1*1024kB 0*2048kB 0*4096kB = 2028kB >> Node 0 Normal: 150*4kB 0*8kB 0*16kB 1*32kB 0*64kB 5*128kB 0*256kB 0*512kB >> 1*1024kB 0*2048kB 0*4096kB = 2296kB >> 85571 total pagecache pages >> 6 pages in swap cache >> Swap cache stats: add 6, delete 0, find 0/0 >> Free swap = 1574304kB >> Total swap = 1574328kB >> 131040 pages RAM >> 0 pages HighMem >> 6706 pages reserved >> 75752 pages shared >> 72758 pages non-shared >> em28xx #0: unable to allocate 165120 bytes for transfer buffer 4 > > The situation is as follows: from user space the open() function is called > which ends > finally at em28xx_v4l2_open() in the em28xx-new driver. Then the driver tries > to allocate > some memory in em28xx_init_isoc(), but this fails (out of memory) and then an > error > message is printed "em28xx #0: unable to allocate 165120 bytes for transfer > buffer 4". > The error code is returned to user space and then ZoneMinder and webcam > should handle > the return value correctly (i.e. not use -1 as a valid file descriptor, warn > the user > and stop without segmentation fault.) > > I don't know however why the memory allocation fails, either you don't have > enough free > RAM or you don't have any free RAM which can be used for DMA operations. >
let me check that issue till ~Monday/Tuesday I think we already had something in that area in the past. Markus >> Am 22.01.2009 um 07:52 schrieb Németh Márton: >>> Could you please send your /root/.webcamrc ? (Please change the password >>> field in it to *** before sending, if any.) >> >> My .webcamrc can be found here: >> http://www.file-upload.net/download-1400648/webcamrc.txt.html > > Your .webcamrc needs a bit improved. The "input" and "norm" parameters are > always needed by "webcam", I think. You can find out the correct parameters by > running the "v4l-info" (it is in package v4l-conf in Debian) and choose one > input name from the section "inputs" and choose one standard name from the > section "standards" ("webcam" calls this parameter "norm"). > > Regards, > > Márton Németh > _______________________________________________ Em28xx mailing list Em28xx@mcentral.de http://mcentral.de/mailman/listinfo/em28xx