boundarydevices / linux

Kernel tree for Boundary Devices platforms
194 stars 290 forks source link

TW686x driver crash at VIDIOC_REQBUFS. #39

Closed sheeaza closed 6 years ago

sheeaza commented 6 years ago

platform: imx6q kernel version: 4.1.15

I have write a v4l2 program to get frame from tw6865, but sometimes the kernel will crash at ioctl(fd_cap_v4l, VIDIOC_REQBUFS, &rq_buf))

full code is below:

memset(&rq_buf, 0, sizeof(rq_buf));
    rq_buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    rq_buf.memory = V4L2_MEMORY_MMAP;
    rq_buf.count = V4L2_BUFFER_NUM;
    if(ioctl(fd_cap_v4l, VIDIOC_REQBUFS, &rq_buf)) {
        printf("this device dose not support mmap\n");
        goto error;
    }

The dmesg is here:

[   22.820372] gfp: 4
[   22.821124] ------------[ cut here ]------------
[   22.824444] Kernel BUG at 800e5490 [verbose debug info unavailable]
[   22.829414] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
[   22.833949] Modules linked in: mxc_v4l2_capture ipu_bg_overlay_sdc ipu_still v4l2_int_device ipu_prp_enc ipu_csi_enc ipu_fg_overlay_sdc mxc_dcic
[   22.845752] CPU: 3 PID: 870 Comm: gles-surround-v Tainted: G        W  O    4.1.15-2.0.1+gb63f3f5 #7
[   22.853584] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[   22.858811] task: a87f6d40 ti: a9ade000 task.ti: a9ade000
[   22.862925] PC is at new_slab+0x1f0/0x210
[   22.865636] LR is at new_slab+0x1f0/0x210
[   22.868350] pc : [<800e5490>]    lr : [<800e5490>]    psr: 600d0093
               sp : a9adfcc0  ip : 00000000  fp : 00000000
[   22.877223] r10: 00000000  r9 : a8001f00  r8 : 2ab74000
[   22.881148] r7 : a9ade000  r6 : ab731230  r5 : 80400040  r4 : 80bbd230
[   22.886377] r3 : 00000000  r2 : 00000000  r1 : 80a67c40  r0 : 00000006
[   22.891606] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   22.897528] Control: 10c53c7d  Table: 399b004a  DAC: 00000015
[   22.901974] Process gles-surround-v (pid: 870, stack limit = 0xa9ade210)
[   22.907375] Stack: (0xa9adfcc0 to 0xa9ae0000)
[   22.910439] fcc0: 80bbd230 80400040 ab731230 a9ade000 2ab74000 a8001f00 00000000 800e6408
[   22.917321] fce0: 80bbe4d4 600d0013 000080d4 ab731230 a9b5a500 000082d2 ffffffff 00400040
[   22.924202] fd00: 00000010 a9a9e800 00000000 800db4b0 00000010 a9a9e800 00000000 00400040
[   22.931082] fd20: ff000000 ffffffff 000080d2 80557dd0 80c781e8 0000c3fb a8001f00 80bbe6bc
[   22.937963] fd40: 000080d4 a9ade000 a9adfd58 00000000 00000000 800e670c a9a9ec00 000a9000
[   22.944843] fd60: 00000002 a8856444 a9a9ec00 a9a9ec00 80557d88 80557db8 a9a9ec00 a8856444
[   22.951724] fd80: 00000002 80552cf4 00000000 00130012 00000001 00000001 00000003 00000002
[   22.958616] fda0: 00000000 a8856560 a8856540 a8856444 805701e8 00000000 a9adfe78 a8856478
[   22.965508] fdc0: a9b5a200 80553888 a8856560 a8856540 00000003 00000001 a87e7c08 a9adfe78
[   22.972401] fde0: a87e7c00 a9204000 805434f4 00000000 a9204000 a9b5a200 a9b5a200 8055425c
[   22.979294] fe00: 00000003 c0145608 a87e7c00 80542818 00000000 00000002 a9adfef0 a9adfe78
[   22.986187] fe20: 80c018c8 00000000 00000020 00000080 a91b0000 80bbd260 abc5fce0 a8467400
[   22.993080] fe40: a9adfe48 800e5958 810725b8 c0145608 00000014 00000000 00000003 7ef8d8c0
[   22.999973] fe60: a9adfe78 80542568 00000014 80542294 a9204000 00000000 00000003 00000001
[   23.006866] fe80: 00000001 00000000 00000000 800f80d8 a9adfeac a91b0000 140400fb 800d449c
[   23.013759] fea0: a8dc9898 800d4514 a8dc9908 00000002 a88e26d0 a6068dd0 a8dc9900 00000000
[   23.020652] fec0: a9204f00 a9adff74 00000001 ffffff9c a91b0000 8000f604 a9ade000 00000000
[   23.027545] fee0: 810725b8 800f9448 00000041 000a9000 a88e26d0 a6068dd0 9087e795 a87e7c00
[   23.034438] ff00: a9204000 c0145608 7ef8d8c0 a8856608 a9ade000 00000000 810725b8 8053ec8c
[   23.041331] ff20: 7ef8d8c0 a88ca1a0 a9204000 0000000a 7ef8d8c0 800fb844 a9adff40 800e50d0
[   23.048224] ff40: 80bbe728 0000000a a9204000 a91b0000 a88ca1a0 a9204008 00000020 00000000
[   23.055116] ff60: 810725b8 800ea90c 00000000 00000000 a9204001 0000000a a9204000 c0145608
[   23.062009] ff80: 7ef8d8c0 a9ade000 00000000 800fba98 7ef8db60 00000001 7ef8d8c0 00000036
[   23.068901] ffa0: 8000f604 8000f480 7ef8db60 00000001 0000000a c0145608 7ef8d8c0 00000003
[   23.075794] ffc0: 7ef8db60 00000001 7ef8d8c0 00000036 00000002 7ef8d9e0 7ef8dbb4 810725b8
[   23.082687] ffe0: 00029694 7ef8d89c 000157fc 75cea2bc 600d0010 0000000a 00000000 00000000
[   23.089605] [<800e5490>] (new_slab) from [<800e6408>] (__slab_alloc.constprop.1+0x2dc/0x344)
[   23.096770] [<800e6408>] (__slab_alloc.constprop.1) from [<800e670c>] (kmem_cache_alloc+0x11c/0x15c)
[   23.104639] [<800e670c>] (kmem_cache_alloc) from [<80557db8>] (vb2_vmalloc_alloc+0x30/0xb8)
[   23.111718] [<80557db8>] (vb2_vmalloc_alloc) from [<80552cf4>] (__vb2_queue_alloc+0x134/0x4d0)
[   23.119051] [<80552cf4>] (__vb2_queue_alloc) from [<80553888>] (__reqbufs+0x138/0x348)
[   23.125690] [<80553888>] (__reqbufs) from [<8055425c>] (vb2_ioctl_reqbufs+0x58/0x80)
[   23.132160] [<8055425c>] (vb2_ioctl_reqbufs) from [<80542818>] (__video_do_ioctl+0x2b0/0x324)
[   23.139408] [<80542818>] (__video_do_ioctl) from [<80542294>] (video_usercopy+0x1b8/0x480)
[   23.146393] [<80542294>] (video_usercopy) from [<8053ec8c>] (v4l2_ioctl+0x118/0x150)
[   23.152860] [<8053ec8c>] (v4l2_ioctl) from [<800fb844>] (do_vfs_ioctl+0x3e8/0x608)
[   23.159150] [<800fb844>] (do_vfs_ioctl) from [<800fba98>] (SyS_ioctl+0x34/0x5c)
[   23.165187] [<800fba98>] (SyS_ioctl) from [<8000f480>] (ret_fast_syscall+0x0/0x3c)
[   23.171474] Code: e30f0d38 e1a01003 e34800a1 eb1cd375 (e7f001f2) 
[   23.176282] ---[ end trace 4b2544b1c6bf4015 ]---
gibsson commented 6 years ago

Hi,

Please check if this crash still occurs with latest 4.1.15_2.0.0 revision: https://github.com/boundarydevices/linux-imx6/commit/511c42e0

Regards, Gary

gibsson commented 6 years ago

Hi,

With no answer for a month, we consider the issue closed.

Regards, Gary