In the video surveillance project, has been using the 2.6.36 kernel, has been very normal, but these days for 3.0.1 kernel, start the program, but there was an error, as follows:
./Test_usb_camera xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxv4l2_open ID=2Unable to handle kernel NULL pointer dereference atVirtualAddress00000060PGD=cbc08000[00000060] *pgd=5c7d6831, *pte=00000000, *ppte=00000000Internal error:oops: -[#2]modules Linkedinch: CPU:0Tainted:g D W (3.0.1#676) PC isAt video_devdata+0x18/0x30LR isAt dev_open+0x28/0x194PC: [<c0352fbc>] LR: [<c036359c>] PSR:60000013sp:cc7f5d30 ip:cc7f5d40 fp:cc7f5d3cr10:c081b880 R9:00000026r8:cc7e78c8r7:cc423008 r6:cc7e78c8 r5:cc7bc200 r4:cc423000r3:00000003r2:c089e880 R1:00000000r0:cc7e78c8Flags:nZCv IRQs on Fiqs on Mode svc_32 ISA ARM Segment usercontrol:00c5387d table:5bc08008 DA C:00000015Process Test_usb_camera (PID: the, Stack limit =0xcc7f4268) Stack: (0xcc7f5d30To0xcc7f6000) 5d20:cc7f5d6c cc7f5d40 c036359c c0352fb05d40:c0363574 cc423000 cc7bc200 cc7e78c 8 cc423008 cc7bc20000000026cc1271805d60:cc7f5d8c cc7f5d70 c035333c c036358000000000 00000000cc721ac0 cc7e78c85d80:cc7f5dbc cc7f5d90 c00ef5b0 c0353298 cc7f5e2c cc7f5ed000000000cc7bc2005da0:00000000cc7e78c8 c00ef490 cc127180 cc7f5df4 cc7f5dc0 c00ead14 c00ef49c5dc0:cc080800 cc40ff00 cc7e78c8 cc7f5ed0 cc7bc200 00000000Cc7bce80000008025de0:00000026 00000000cc7f5e1c cc7f5df8 c00eaf50 c00eabb4 cc7bce80 cc7f5e8c5e00:cc7e78c8 cc7f5ed000000000cc7f5e8c cc7f5e64 cc7f5e20 c00f8488 c00eaef45e20:cc7a3005 c088a480 cc7f5e64 cc40ff00 cc080800 cc7e78c8 cc7f5e64 cc7f 5ed05e40:ffffff9c cc7f5f60 cc7f4000 cc7a3000 cc7f4000 cc7f5e8c cc7f5ec4 cc7f5e685e60:c00f992c c00f830c cc7f5e940000000033db258000000000 66340397Bee98b705e80:00000068 00000000 00000000CC40FF00 cc12718000000000 00000000 000000015ea0:cc7f5f60 cc7f5ed0 ffffff9c cc7a3000 cc7f4000 ffffff9c cc7f5f54 cc7f5ec85ec0:c00f9d04 c00f987400000041 00000000CC40FF00 cc127180 d9d3cea0000000065ee0:cc7a3005 cc40f820 cc07cc00 cc7e78c800000101 00000000 00000000 000000005f00:00000000 00000000 00000004CC7B50C0 Cc7b50c8 CC7B50C400000000cc7f40005f20:cc7f5f5400000803 00000000 00000000 00000001 00000001 00000802 000000005f40:00000004cc7a3000 cc7f5f94 cc7f5f58 c00eaa78 C00F9CD800000000 000000005f60:00000802 00000000 00000026 00000100 00000001Bee98e84 00067ECC000000055f80:c0036ce800000000CC7F5FA4 cc7f5f98 c00eab84 c00ea98800000000CC7F5FA85FA0:C0036B40 c00eab6c00000001Bee98e84 000681c800000802 0000000000085c8c5fc0:00000001Bee98e84 00067ECC00000005bee98d0c00000000000874b8 0000000a5fe0:00067ed4 bee98be0 000089b4 0001fe4c40000010000681c800000000 00000000[<c0352fbc>] (video_devdata+0x18/0x30) from[<c036359c>] (dev_open+0x28/0x194)[<c036359c>] (dev_open+0x28/0x194) from[<c035333c>] (v4l2_open+0xb0/0xd8)[<c035333c>] (v4l2_open+0xb0/0xd8) from[<c00ef5b0>] (chrdev_open+0x120/0x1a4)[<c00ef5b0>] (chrdev_open+0x120/0x1a4) from[<c00ead14>] (__dentry_open+0x16c/0x2c4)[<c00ead14>] (__dentry_open+0x16c/0x2c4) from[<c00eaf50>] (nameidata_to_filp+0x68/0x70)[<c00eaf50>] (nameidata_to_filp+0x68/0x70) from[<c00f8488>] (do_last+0x188/0x6b0)[<c00f8488>] (do_last+0x188/0x6b0) from[<c00f992c>] (path_openat+0xc4/0X3A4)[<c00f992c>] (path_openat+0xc4/0X3A4) from[<c00f9d04>] (do_filp_open+0x38/0x8c)[<c00f9d04>] (do_filp_open+0x38/0x8c) from[<c00eaa78>] (do_sys_open+0XFC/0x1d0)[<c00eaa78>] (do_sys_open+0XFC/0x1d0) from[<c00eab84>] (sys_open+0x24/0x28)[<c00eab84>] (sys_open+0x24/0x28) from[<c0036b40>] (ret_fast_syscall+0x0/0x30) code:e24cb004 e590200c e5921020 e59f2010 (e5913060)---[end trace DA227214A82491BA]---segmentation fault[[email Protected]/]# [[email protected]/]#
Perfect OK6410 Camera Driver The above analysis shows that the Dev_open function of the kernel of the OK6410 new version (3.0.1) is problematic, in fact he is assigned to the open member of the v4l2_file_operations struct as a function pointer call. The function signature of his implementation part is an int dev_open (struct file *file) in the./DRIVERS/MEDIA/VIDEO/GSPCA/GSPCA.C 1202 row to find the function implementation. The V4l2_file_operations open member is defined as an int (*open) (struct node*,struct file *), so the result of an open failure occurs when the Dev_open is eventually invoked through the open member function pointer. We want to change the definition of the open member of v4l2_file_operations to Int (*open) (struct file *), and also to modify the invocation of the node parameter in the relevant invocation part, that is, delete the node parameter.
(1) header file:./include/media/v4l2-dev.h 48 lines 49 lines to int (*open) (struct file *); Int (*release) (struct file *);
(2) file C:./drivers/media/video/v4l2-dev.c the No. 281 line should read: ret= Vdev->fops->open (FILP);
The NO. 295 line should read: Vdev->fops->release (FILP);
(3)/driver/media/video/uvc/uvc_v4l2.c uvc_v4l2_open (struct inode *inode,struct file * file) function and uvc_v4l2_ Release (struct inode *inode,struct file *file) function,
Changed to: Uvc_v4l2_open (struct file *file) uvc_v4l2_release (struct file *file)
Then recompile the kernel.
Also: be aware that your camera head device files are the same as in the test code!!!!!!!!
ok6410 3.0.1 kernel Call V4L Interface Error resolution method (GO)