[libcamera-devel] Oooops in 5.4-y unicam+ov5647

Dave Stevenson dave.stevenson at raspberrypi.com
Mon Jun 22 18:12:06 CEST 2020


Hi Jacopo

On Mon, 22 Jun 2020 at 15:45, Jacopo Mondi <jacopo at jmondi.org> wrote:
>
> Hello Dave, Naush,
>    I'm reporting a kernel oooops I have noticed in
> unicam_stop_streaming() when testing with rpi-5.4-y kernel.
>
> How did I get there:
> I'm testing the upported ov5647 driver I'm working on with mainline
> and the unicam patches sent by Laurent to linux-media. I started
> noticing oooops there, and then to rule out any possible newly
> introduced bug, I switched back to the downstream 5.4-y kernel
> from your github repository.
>
> How to trigger it:
> I was testing my mainline driver with yavta, before proceeding to test
> it with libcamera. Running a few yavta capture sequences leads to the
> following oooops in unicam_stop_streaming()
>
> I just triggered it by running, one after the other:
>  ./yavta -s 2592x1944 -f SBGGR10 -c /dev/video0
>  ./yavta -s 1280x800 -f SBGGR10 -c /dev/video0
>  ./yavta -s 1280x800 -f SBGGR8 -c /dev/video0
>
> [   98.166559] ------------[ cut here ]------------
> [   98.166613] WARNING: CPU: 2 PID: 1014 at drivers/media/common/videobuf2/videobuf2-core.c:1882 __vb2_queue_cancel+0x244/0x2bc [videobuf2_common]
> [   98.166626] Modules linked in: fuse 8021q garp stp llc ov5647 evdev joydev brcmfmac brcmutil vc4 cec sha256_generic libsha256 v3d gpu_sched drm_kms_helper cfg80211 drm bcm2835_unicam bcm2835_codec(C) raspberrypi_hwmon i2c_mux_pinctrl i2c_mux v4l2_dv_timings rfkill bcm2835_v4l2(C) bcm2835_isp(C) v4l2_mem2mem v4l2_fwnode bcm2835_mmal_vchiq(C) videobuf2_vmalloc videobuf2_dma_contig drm_panel_orientation_quirks videobuf2_memops videobuf2_v4l2 videobuf2_common snd_soc_core i2c_bcm2835 videodev mc snd_compress snd_bcm2835(C) snd_pcm_dmaengine vc_sm_cma(C) snd_pcm rpivid_mem snd_timer snd syscopyarea sysfillrect sysimgblt fb_sys_fops uio_pdrv_genirq uio i2c_dev ip_tables x_tables ipv6 nf_defrag_ipv6
> [   98.166894] CPU: 2 PID: 1014 Comm: yavta Tainted: G         C        5.4.47-v7l+ #3
> [   98.166902] Hardware name: BCM2711
> [   98.166910] Backtrace:
> [   98.166934] [<c020dfd8>] (dump_backtrace) from [<c020e340>] (show_stack+0x20/0x24)
> [   98.166948]  r7:ffffffff r6:00000000 r5:60000013 r4:c129c420
> [   98.166964] [<c020e320>] (show_stack) from [<c0a30840>] (dump_stack+0xd8/0x11c)
> [   98.166981] [<c0a30768>] (dump_stack) from [<c0221e58>] (__warn+0xe0/0x108)
> [   98.166995]  r10:d6941040 r9:00000009 r8:bf0db5b8 r7:0000075a r6:00000009 r5:bf0db5b8
> [   98.167003]  r4:bf0e0ae0 r3:00000000
> [   98.167019] [<c0221d78>] (__warn) from [<c0222220>] (warn_slowpath_fmt+0x70/0xc0)
> [   98.167031]  r7:0000075a r6:bf0e0ae0 r5:c1204f88 r4:00000000
> [   98.167064] [<c02221b4>] (warn_slowpath_fmt) from [<bf0db5b8>] (__vb2_queue_cancel+0x244/0x2bc [videobuf2_common])
> [   98.167076]  r9:00000008 r8:00000001 r7:d6d53408 r6:d6d53560 r5:d6d53468 r4:d6d53408
> [   98.167122] [<bf0db374>] (__vb2_queue_cancel [videobuf2_common]) from [<bf0ddfbc>] (vb2_core_queue_release+0x28/0x48 [videobuf2_common])
> [   98.167134]  r10:d6941040 r9:00000008 r8:00000001 r7:d6e53c40 r6:d6d53560 r5:d6d53468
> [   98.167143]  r4:d6d53408 r3:d5f57d00
> [   98.167184] [<bf0ddf94>] (vb2_core_queue_release [videobuf2_common]) from [<bf309b48>] (_vb2_fop_release+0x74/0x94 [videobuf2_v4l2])
> [   98.167193]  r5:d61f03c0 r4:00000000
> [   98.167227] [<bf309ad4>] (_vb2_fop_release [videobuf2_v4l2]) from [<bf208680>] (unicam_release+0x4c/0xd8 [bcm2835_unicam])
> [   98.167238]  r7:d6e53c40 r6:d61f03c0 r5:d6d53548 r4:d6d532f0
> [   98.167328] [<bf208634>] (unicam_release [bcm2835_unicam]) from [<bf1b56e0>] (v4l2_release+0xd8/0xe4 [videodev])
> [   98.167341]  r9:00000008 r8:d7bdbd48 r7:d74750d0 r6:d6941040 r5:d61f03c0 r4:d6d53560
> [   98.167429] [<bf1b5608>] (v4l2_release [videodev]) from [<c03fc178>] (__fput+0xa4/0x23c)
> [   98.167439]  r5:000e001f r4:d61f03c0
> [   98.167455] [<c03fc0d4>] (__fput) from [<c03fc328>] (____fput+0x18/0x1c)
> [   98.167467]  r10:ffffe000 r9:c12b5e14 r8:d634b314 r7:d634adc0 r6:d634b2f0 r5:d61f0cc0
> [   98.167475]  r4:d61f03c0
> [   98.167493] [<c03fc310>] (____fput) from [<c02430a0>] (task_work_run+0xb4/0xd8)
> [   98.167511] [<c0242fec>] (task_work_run) from [<c0226708>] (do_exit+0x470/0xb7c)
> [   98.167523]  r9:00000000 r8:d7773e40 r7:d694bf00 r6:ffffe000 r5:d7773e00 r4:d634adc0
> [   98.167539] [<c0226298>] (do_exit) from [<c0226eb0>] (do_group_exit+0x50/0xe0)
> [   98.167547]  r7:d694bf00
> [   98.167564] [<c0226e60>] (do_group_exit) from [<c023442c>] (get_signal+0x1a8/0xa84)
> [   98.167575]  r7:d694bf00 r6:00000008 r5:d5e21fb0 r4:00418004
> [   98.167591] [<c0234284>] (get_signal) from [<c020cbf4>] (do_work_pending+0x2f8/0x5a0)
> [   98.167603]  r10:c1204f88 r9:5ac3c35a r8:fffffe30 r7:d5e21f44 r6:b6e91518 r5:d5e21fb0
> [   98.167610]  r4:ffffe000
> [   98.167624] [<c020c8fc>] (do_work_pending) from [<c0201034>] (slow_work_pending+0xc/0x20)
> [   98.167633] Exception stack(0xd5e21fb0 to 0xd5e21ff8)
> [   98.167644] 1fa0:                                     00000003 c0445611 bef0a174 00000008
> [   98.167657] 1fc0: bef0a2c8 00000003 00000001 00000036 b6cb7000 00057518 00000000 00000000
> [   98.167668] 1fe0: 00028040 bef0a06c 000121d4 b6e91518 40000010 00000003
> [   98.167681]  r10:00000036 r9:d5e20000 r8:c02011c4 r7:00000036 r6:00000001 r5:00000003
> [   98.167689]  r4:bef0a2c8
> [   98.167700] ---[ end trace bf5fa2b07cb06a2e ]---
> [   98.167718] videobuf2_common: driver bug: stop_streaming operation is leaving buf d21f432b in active state
> [   98.167739] videobuf2_common: driver bug: stop_streaming operation is leaving buf 7fda19e7 in active state
> [   98.167758] videobuf2_common: driver bug: stop_streaming operation is leaving buf f7ea2781 in active state
> [   98.167776] videobuf2_common: driver bug: stop_streaming operation is leaving buf b82e7d8b in active state
> [   98.167794] videobuf2_common: driver bug: stop_streaming operation is leaving buf 95e2b449 in active state
> [   98.167813] videobuf2_common: driver bug: stop_streaming operation is leaving buf 98893ee5 in active state
> [   98.167831] videobuf2_common: driver bug: stop_streaming operation is leaving buf e78f62ba in active state
> [   98.167850] videobuf2_common: driver bug: stop_streaming operation is leaving buf a8953ddc in active state
>
> Have you ever noticied anything similar ?

I think this is the favourite of drivers not returning queued but
unused buffers on stop_streaming, or on a failed start_streaming.
It's on my list of things to check through for both Unicam and the
ISP, but is harmless as videobuf2 cleans up for us having complained
loudly.

  Dave


More information about the libcamera-devel mailing list