Skip to content

Incorrect handling of stop_streaming(), warnings in dmesg #82

@antonsviridenko

Description

@antonsviridenko
[ 2794.047988] ------------[ cut here ]------------
[ 2794.047992] WARNING: CPU: 2 PID: 20517 at drivers/media/v4l2-core/videobuf2-core.c:1651 __vb2_queue_cancel+0x14b/0x230
[ 2794.047993] Modules linked in: ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat solo6x10 x86_pkg_temp_thermal
[ 2794.047997] CPU: 2 PID: 20517 Comm: ffplay Tainted: G        W       4.10.0-gentoo #1
[ 2794.047998] Hardware name: ASUS All Series/B85M-E, BIOS 2301 03/30/2015
[ 2794.047999] Call Trace:
[ 2794.048002]  dump_stack+0x4f/0x72
[ 2794.048005]  __warn+0xc7/0xf0
[ 2794.048006]  warn_slowpath_null+0x18/0x20
[ 2794.048007]  __vb2_queue_cancel+0x14b/0x230
[ 2794.048008]  vb2_core_streamoff+0x23/0x90
[ 2794.048009]  vb2_streamoff+0x24/0x50
[ 2794.048010]  vb2_ioctl_streamoff+0x3d/0x50
[ 2794.048012]  v4l_streamoff+0x15/0x20
[ 2794.048013]  __video_do_ioctl+0x25e/0x2f0
[ 2794.048015]  video_usercopy+0x279/0x520
[ 2794.048016]  ? v4l_enum_fmt+0x1330/0x1330
[ 2794.048017]  video_ioctl2+0x10/0x20
[ 2794.048019]  v4l2_ioctl+0xce/0xe0
[ 2794.048021]  do_vfs_ioctl+0x8b/0x5b0
[ 2794.048023]  ? __fget+0x72/0xa0
[ 2794.048024]  SyS_ioctl+0x74/0x80
[ 2794.048026]  entry_SYSCALL_64_fastpath+0x13/0x94
[ 2794.048027] RIP: 0033:0x7fc15d511b27
[ 2794.048028] RSP: 002b:00007ffef6337a88 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 2794.048029] RAX: ffffffffffffffda RBX: 00007fc14c503000 RCX: 00007fc15d511b27
[ 2794.048030] RDX: 00007ffef6337a94 RSI: 0000000040045613 RDI: 0000000000000006
[ 2794.048030] RBP: 0000000000000040 R08: 00000000ffffffff R09: 00007fc150001140
[ 2794.048031] R10: 0000000000000243 R11: 0000000000000246 R12: 00000000000002c0
[ 2794.048031] R13: 00000000000002c0 R14: 0000000000016000 R15: fffffffffffffff0
[ 2794.048032] ---[ end trace c41530fe2842a40e ]---

        /*
         * If you see this warning, then the driver isn't cleaning up properly
         * in stop_streaming(). See the stop_streaming() documentation in
         * videobuf2-core.h for more information how buffers should be returned
         * to vb2 in stop_streaming().
         */
        if (WARN_ON(atomic_read(&q->owned_by_drv_count))) {
                for (i = 0; i < q->num_buffers; ++i)
                        if (q->bufs[i]->state == VB2_BUF_STATE_ACTIVE)
                                vb2_buffer_done(q->bufs[i], VB2_BUF_STATE_ERROR);
                /* Must be zero now */
                WARN_ON(atomic_read(&q->owned_by_drv_count));
        }
 * @stop_streaming:     called when 'streaming' state must be disabled; driver
 *                      should stop any DMA transactions or wait until they
 *                      finish and give back all buffers it got from &buf_queue
 *                      callback by calling vb2_buffer_done() with either
 *                      %VB2_BUF_STATE_DONE or %VB2_BUF_STATE_ERROR; may use
 *                      vb2_wait_for_all_buffers() function

this is not performed by stop_streaming() in solo6x10 module

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions