g_webcam gadget needs patch

Post Reply
Posts: 9
Joined: Tue Oct 14, 2014 7:36 am
languages_spoken: english
Has thanked: 0
Been thanked: 0

g_webcam gadget needs patch

Post by slycheese »

I have been trying to work with the g_webcam gadget and came across a warning in the kernel log. After doing lots of reading I discovered that the warning comes from a bug in the Linux base kernel from long ago. It has been fixed as of kernel 3.16 (but the XU3 is currently running off 3.10). I'm just posting this message to help others who might try to use the g_webcam gadget (or really, any gadget that uses the uvc queue, I think).

This is the warning in the kernel log that comes up when you start the g_webcam gadget (with: sudo modprob g_webcam):

[ 5206.421351] [c4] g_webcam gadget: uvc_function_bind
[ 5206.421487] [c4] ------------[ cut here ]------------
[ 5206.421511] [c4] WARNING: at drivers/media/v4l2-core/videobuf2-core.c:2134 vb2_queue_init+0xf8/0x1a0()
[ 5206.421520] [c4] Modules linked in: g_webcam(+) videobuf2_vmalloc libcomposite ioboard_bh1780 ioboard_bmp180 joydev ioboard_keyled 8192cu bnep rfcomm bluetooth rfkill ina231_sensor fuse nls_cp437 vfat fat
[ 5206.421617] [c4] CPU: 4 PID: 3693 Comm: modprobe Not tainted 3.10.69 #1
[ 5206.421625] [c4] Backtrace:
[ 5206.421645] [c4] [<c0012904>] (dump_backtrace+0x0/0x114) from [<c0012c3c>] (show_stack+0x20/0x24)
[ 5206.421655] [c4] r6:c07d2d14 r5:00000856 r4:00000000 r3:00000000
[ 5206.421689] [c4] [<c0012c1c>] (show_stack+0x0/0x24) from [<c05c8fc4>] (dump_stack+0x20/0x28)
[ 5206.421707] [c4] [<c05c8fa4>] (dump_stack+0x0/0x28) from [<c002aa5c>] (warn_slowpath_common+0x5c/0x78)
[ 5206.421721] [c4] [<c002aa00>] (warn_slowpath_common+0x0/0x78) from [<c002aaa4>] (warn_slowpath_null+0x2c/0x34)
[ 5206.421732] [c4] r8:bf1baab8 r7:dc3bc800 r6:bf1b6e54 r5:dd24ff00 r4:dc3bc8d0
[ 5206.421732] r3:00000009
[ 5206.421775] [c4] [<c002aa78>] (warn_slowpath_null+0x0/0x34) from [<c03c9a78>] (vb2_queue_init+0xf8/0x1a0)
[ 5206.421792] [c4] [<c03c9980>] (vb2_queue_init+0x0/0x1a0) from [<bf1ba628>] (uvc_function_bind+0x334/0x4bc [g_webcam])
[ 5206.421802] [c4] r4:dc3bc808 r3:000002bc
[ 5206.421834] [c4] [<bf1ba2f4>] (uvc_function_bind+0x0/0x4bc [g_webcam]) from [<bf1a3554>] (usb_add_function+0x68/0xf8 [libcomposite])
[ 5206.421852] [c4] [<bf1a34ec>] (usb_add_function+0x0/0xf8 [libcomposite]) from [<bf1ba9e0>] (uvc_bind_config+0x1a8/0x224 [g_webcam])
[ 5206.421863] [c4] r7:bf1b6ed8 r6:bf1b6c40 r5:bf1ba2f4 r4:bf1b53d4
[ 5206.421899] [c4] [<bf1ba838>] (uvc_bind_config+0x0/0x224 [g_webcam]) from [<bf1baa90>] (webcam_config_bind+0x34/0x40 [g_webcam])
[ 5206.421916] [c4] [<bf1baa5c>] (webcam_config_bind+0x0/0x40 [g_webcam]) from [<bf1a399c>] (usb_add_config+0x44/0xa8 [libcomposite])
[ 5206.421934] [c4] [<bf1a3958>] (usb_add_config+0x0/0xa8 [libcomposite]) from [<bf1ba7fc>] (webcam_bind+0x4c/0x88 [g_webcam])
[ 5206.421954] [c4] [<bf1ba7b0>] (webcam_bind+0x0/0x88 [g_webcam]) from [<bf1a4c84>] (composite_bind+0x98/0x1b8 [libcomposite])
[ 5206.421964] [c4] r5:bf1b6f4c r4:dd24ff00
[ 5206.421994] [c4] [<bf1a4bec>] (composite_bind+0x0/0x1b8 [libcomposite]) from [<c0385e70>] (udc_bind_to_driver+0x3c/0xb8)
[ 5206.422008] [c4] [<c0385e34>] (udc_bind_to_driver+0x0/0xb8) from [<c0385f68>] (usb_gadget_probe_driver+0x7c/0xb0)
[ 5206.422016] [c4] r6:bf1a3a00 r5:c08e4078 r4:bf1b6f4c r3:00000000
[ 5206.422051] [c4] [<c0385eec>] (usb_gadget_probe_driver+0x0/0xb0) from [<bf1a2f54>] (usb_composite_probe+0xac/0xe0 [libcomposite])
[ 5206.422059] [c4] r5:bf1a30f4 r4:bf1b6f24
[ 5206.422086] [c4] [<bf1a2ea8>] (usb_composite_probe+0x0/0xe0 [libcomposite]) from [<bf1baab0>] (webcam_init+0x14/0x1c [g_webcam])
[ 5206.422095] [c4] r8:bf1b6fa8 r7:00000000 r6:c090de00 r5:bf1b6fb4 r4:dbd0a000
[ 5206.422095] r3:00000000
[ 5206.422139] [c4] [<bf1baa9c>] (webcam_init+0x0/0x1c [g_webcam]) from [<c0008674>] (do_one_initcall+0x44/0x168)
[ 5206.422156] [c4] [<c0008630>] (do_one_initcall+0x0/0x168) from [<c0093638>] (load_module+0x1654/0x1f24)
[ 5206.422170] [c4] [<c0091fe4>] (load_module+0x0/0x1f24) from [<c0094070>] (SyS_finit_module+0x78/0x7c)
[ 5206.422185] [c4] [<c0093ff8>] (SyS_finit_module+0x0/0x7c) from [<c000e640>] (ret_fast_syscall+0x0/0x30)
[ 5206.422194] [c4] r6:b6f10148 r5:b6f10b10 r4:b6f10230
[ 5206.422215] [c4] ---[ end trace 30bc7787c7846969 ]---
[ 5206.423031] [c4] g_webcam gadget: Webcam Video Gadget
[ 5206.423042] [c4] g_webcam gadget: g_webcam ready
[ 5206.431942] [c4] dwc3 12400000.dwc3: request (null) was not queued to ep2in
[ 5206.437677] [c4] dwc3 12400000.dwc3: request (null) was not queued to ep2in
[ 5206.444773] [c4] dwc3 12400000.dwc3: request (null) was not queued to ep2in
[ 5206.451875] [c4] dwc3 12400000.dwc3: request (null) was not queued to ep2in

The code change needed to fix it can be found in this message:

http://article.gmane.org/gmane.linux.dr ... h=g_webcam


Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 1 guest