Re: em28xx vb2 warnings
Am 28.07.2014 um 17:27 schrieb Hans Verkuil: ... OK, I looked at it: the problem is in get_next_buf() and finish_field_prepare_next(). In get_next_buf() the driver gets a buffer from the active list and deletes it from that list. In finish_field_prepare_next() that buffer is given back to vb2 via finish_buffer(). But if you stop streaming and em28xx_stop_streaming() is called, then that buffer that is being processed isn't part of the active list anymore and so it is never given back. em28xx_stop_streaming() should give that buffer back as well, and that will keep everything in balance. The easiest solution seems to be to move the list_del() call from get_next_buf() to finish_buffer(). It seemed to work in a quick test, but I haven't looked at vbi support or corner cases. I leave that to you :-) Ok, thank you so far Hans ! I will see what I can do. Regards, Frank -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: em28xx vb2 warnings
On 07/25/2014 06:20 PM, Frank Schäfer wrote: Hi Hans, I'm getting the following warnings with the em28xx driver on streaming stop: [ 7597.346168] WARNING: CPU: 1 PID: 3730 at drivers/media/v4l2-core/videobuf2-core.c:2126 __vb2_queue_cancel+0xf5/0x150 [videobuf2_core]() [ 7597.346171] Modules linked in: em28xx_rc snd_usb_audio ov2640 soc_camera soc_mediabus em28xx_v4l videobuf2_core videobuf2_vmalloc videobuf2_memops snd_usbmidi_lib snd_rawmidi em28xx xt_pkttype xt_LOG xt_limit bnep af_packet bluetooth ip6t_REJECT xt_tcpudp nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_raw ipt_REJECT iptable_raw xt_CT iptable_filter ip6table_mangle nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_ipv4 nf_defrag_ipv4 ip_tables xt_conntrack nf_conntrack ip6table_filter ip6_tables x_tables rc_hauppauge ir_kbd_i2c arc4 tuner_simple tuner_types rtl8187 mac80211 tda9887 fuse tda8290 snd_hda_codec_analog tuner snd_hda_codec_hdmi snd_hda_codec_generic sr_mod cdrom snd_hda_intel snd_hda_controller snd_hda_codec msp3400 snd_hwdep cfg80211 bttv snd_pcm v4l2_common snd_seq ppdev powernow_k8 [ 7597.346230] snd_timer snd_seq_device pcspkr videodev serio_raw snd firewire_ohci firewire_core k8temp rfkill eeprom_93cx6 i2c_nforce2 usb_storage videobuf_dma_sg videobuf_core btcx_risc pata_jmicron rc_core usblp soundcore forcedeth crc_itu_t tveeprom ata_generic floppy sata_nv pata_amd asus_atk0110 parport_pc parport button sg dm_mod autofs4 radeon ttm drm_kms_helper drm fan thermal processor thermal_sys i2c_algo_bit scsi_dh_hp_sw scsi_dh_emc scsi_dh_rdac scsi_dh_alua scsi_dh [ 7597.346268] CPU: 1 PID: 3730 Comm: qv4l2 Tainted: GW 3.16.0-rc6-0.1-desktop+ #18 [ 7597.346271] Hardware name: System manufacturer System Product Name [...] [ 7597.346273] e09d9d3c c0780b62 e09d9d6c c0243359 c091deec [ 7597.346279] 0001 0e92 f870a4a4 084e f87054e5 f87054e5 e6905040 e2f61640 [ 7597.346285] ef85f4c8 e09d9d7c c02433ed 0009 e09d9d94 f87054e5 e2ef6550 [ 7597.346290] Call Trace: [ 7597.346300] [c0780b62] dump_stack+0x48/0x69 [ 7597.346305] [c0243359] warn_slowpath_common+0x79/0x90 [ 7597.346312] [f87054e5] ? __vb2_queue_cancel+0xf5/0x150 [videobuf2_core] [ 7597.346318] [f87054e5] ? __vb2_queue_cancel+0xf5/0x150 [videobuf2_core] [ 7597.346322] [c02433ed] warn_slowpath_null+0x1d/0x20 [ 7597.346327] [f87054e5] __vb2_queue_cancel+0xf5/0x150 [videobuf2_core] [ 7597.346333] [f8706b35] vb2_internal_streamoff+0x35/0x90 [videobuf2_core] [ 7597.346338] [c04b7cbb] ? _copy_from_user+0x3b/0x50 [ 7597.346344] [f8706bc5] vb2_streamoff+0x35/0x60 [videobuf2_core] [ 7597.346350] [c0699433] ? __sys_recvmsg+0x43/0x70 [ 7597.346356] [f8706c27] vb2_ioctl_streamoff+0x37/0x40 [videobuf2_core] [ 7597.346371] [f7c56805] v4l_streamoff+0x15/0x20 [videodev] [ 7597.346382] [f7c5962c] __video_do_ioctl+0x1fc/0x280 [videodev] [ 7597.346394] [f7c5908e] video_usercopy+0x1ce/0x550 [videodev] [ 7597.346399] [c038aac7] ? fsnotify+0x1e7/0x2b0 [ 7597.346410] [f7c59422] video_ioctl2+0x12/0x20 [videodev] [ 7597.346421] [f7c59430] ? video_ioctl2+0x20/0x20 [videodev] [ 7597.346430] [f7c55615] v4l2_ioctl+0xe5/0x120 [videodev] [ 7597.346439] [f7c55530] ? v4l2_open+0xf0/0xf0 [videodev] [ 7597.346443] [c03668e2] do_vfs_ioctl+0x2e2/0x4d0 [ 7597.346449] [c0356a3c] ? vfs_write+0x13c/0x1c0 [ 7597.346452] [c03575df] ? vfs_writev+0x2f/0x50 [ 7597.346455] [c0366b28] SyS_ioctl+0x58/0x80 [ 7597.346460] [c07870ec] sysenter_do_call+0x12/0x16 [ 7597.346463] ---[ end trace 16421a251cba8f63 ]--- There have been quite a few vb2 changes recently. Any idea what's wrong ? Could you take a look at this ? OK, I looked at it: the problem is in get_next_buf() and finish_field_prepare_next(). In get_next_buf() the driver gets a buffer from the active list and deletes it from that list. In finish_field_prepare_next() that buffer is given back to vb2 via finish_buffer(). But if you stop streaming and em28xx_stop_streaming() is called, then that buffer that is being processed isn't part of the active list anymore and so it is never given back. em28xx_stop_streaming() should give that buffer back as well, and that will keep everything in balance. The easiest solution seems to be to move the list_del() call from get_next_buf() to finish_buffer(). It seemed to work in a quick test, but I haven't looked at vbi support or corner cases. I leave that to you :-) Regards, Hans -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: em28xx vb2 warnings
Am 25.07.2014 21:07, schrieb Hans Verkuil: On 07/25/2014 06:20 PM, Frank Schäfer wrote: Hi Hans, I'm getting the following warnings with the em28xx driver on streaming stop: [ 7597.346168] WARNING: CPU: 1 PID: 3730 at drivers/media/v4l2-core/videobuf2-core.c:2126 __vb2_queue_cancel+0xf5/0x150 [videobuf2_core]() [ 7597.346171] Modules linked in: em28xx_rc snd_usb_audio ov2640 soc_camera soc_mediabus em28xx_v4l videobuf2_core videobuf2_vmalloc videobuf2_memops snd_usbmidi_lib snd_rawmidi em28xx xt_pkttype xt_LOG xt_limit bnep af_packet bluetooth ip6t_REJECT xt_tcpudp nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_raw ipt_REJECT iptable_raw xt_CT iptable_filter ip6table_mangle nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_ipv4 nf_defrag_ipv4 ip_tables xt_conntrack nf_conntrack ip6table_filter ip6_tables x_tables rc_hauppauge ir_kbd_i2c arc4 tuner_simple tuner_types rtl8187 mac80211 tda9887 fuse tda8290 snd_hda_codec_analog tuner snd_hda_codec_hdmi snd_hda_codec_generic sr_mod cdrom snd_hda_intel snd_hda_controller snd_hda_codec msp3400 snd_hwdep cfg80211 bttv snd_pcm v4l2_common snd_seq ppdev powernow_k8 [ 7597.346230] snd_timer snd_seq_device pcspkr videodev serio_raw snd firewire_ohci firewire_core k8temp rfkill eeprom_93cx6 i2c_nforce2 usb_storage videobuf_dma_sg videobuf_core btcx_risc pata_jmicron rc_core usblp soundcore forcedeth crc_itu_t tveeprom ata_generic floppy sata_nv pata_amd asus_atk0110 parport_pc parport button sg dm_mod autofs4 radeon ttm drm_kms_helper drm fan thermal processor thermal_sys i2c_algo_bit scsi_dh_hp_sw scsi_dh_emc scsi_dh_rdac scsi_dh_alua scsi_dh [ 7597.346268] CPU: 1 PID: 3730 Comm: qv4l2 Tainted: GW 3.16.0-rc6-0.1-desktop+ #18 [ 7597.346271] Hardware name: System manufacturer System Product Name [...] [ 7597.346273] e09d9d3c c0780b62 e09d9d6c c0243359 c091deec [ 7597.346279] 0001 0e92 f870a4a4 084e f87054e5 f87054e5 e6905040 e2f61640 [ 7597.346285] ef85f4c8 e09d9d7c c02433ed 0009 e09d9d94 f87054e5 e2ef6550 [ 7597.346290] Call Trace: [ 7597.346300] [c0780b62] dump_stack+0x48/0x69 [ 7597.346305] [c0243359] warn_slowpath_common+0x79/0x90 [ 7597.346312] [f87054e5] ? __vb2_queue_cancel+0xf5/0x150 [videobuf2_core] [ 7597.346318] [f87054e5] ? __vb2_queue_cancel+0xf5/0x150 [videobuf2_core] [ 7597.346322] [c02433ed] warn_slowpath_null+0x1d/0x20 [ 7597.346327] [f87054e5] __vb2_queue_cancel+0xf5/0x150 [videobuf2_core] [ 7597.346333] [f8706b35] vb2_internal_streamoff+0x35/0x90 [videobuf2_core] [ 7597.346338] [c04b7cbb] ? _copy_from_user+0x3b/0x50 [ 7597.346344] [f8706bc5] vb2_streamoff+0x35/0x60 [videobuf2_core] [ 7597.346350] [c0699433] ? __sys_recvmsg+0x43/0x70 [ 7597.346356] [f8706c27] vb2_ioctl_streamoff+0x37/0x40 [videobuf2_core] [ 7597.346371] [f7c56805] v4l_streamoff+0x15/0x20 [videodev] [ 7597.346382] [f7c5962c] __video_do_ioctl+0x1fc/0x280 [videodev] [ 7597.346394] [f7c5908e] video_usercopy+0x1ce/0x550 [videodev] [ 7597.346399] [c038aac7] ? fsnotify+0x1e7/0x2b0 [ 7597.346410] [f7c59422] video_ioctl2+0x12/0x20 [videodev] [ 7597.346421] [f7c59430] ? video_ioctl2+0x20/0x20 [videodev] [ 7597.346430] [f7c55615] v4l2_ioctl+0xe5/0x120 [videodev] [ 7597.346439] [f7c55530] ? v4l2_open+0xf0/0xf0 [videodev] [ 7597.346443] [c03668e2] do_vfs_ioctl+0x2e2/0x4d0 [ 7597.346449] [c0356a3c] ? vfs_write+0x13c/0x1c0 [ 7597.346452] [c03575df] ? vfs_writev+0x2f/0x50 [ 7597.346455] [c0366b28] SyS_ioctl+0x58/0x80 [ 7597.346460] [c07870ec] sysenter_do_call+0x12/0x16 [ 7597.346463] ---[ end trace 16421a251cba8f63 ]--- There have been quite a few vb2 changes recently. Any idea what's wrong ? Could you take a look at this ? What it means is that the driver appears not to have given back all buffers to the vb2 core. I do see that this doesn't happen in start_streaming if an error occurs there (queued buffers should be returned to state DEQUEUED in that case), but stop_streaming seems to return it perfectly fine. If in your test case start_streaming failed, then that would explain it. No, streaming start doesn't fail. The test case is simple: start qv4l2, start streaming, stop streaming. Enable the VIDEO_ADV_DEBUG config option which will dump an overview of the vb2 ops: mismatched counts should be reported. I also enabled em28xx core_debug: ... [ 165.248346] usbcore: registered new interface driver em28xx [ 170.832072] usb 1-8: new high-speed USB device number 7 using ehci-pci [ 170.950968] usb 1-8: New USB device found, idVendor=2040, idProduct=4200 [ 170.950974] usb 1-8: New USB device strings: Mfr=0, Product=1, SerialNumber=2 [ 170.950976] usb 1-8: Product: WinTV USB2 [ 170.950979] usb 1-8: SerialNumber: 00 [ 170.952094] em28xx: New device WinTV USB2 @ 480 Mbps (2040:4200, interface 0, class 0) [ 170.952098] em28xx: Video interface 0 found: bulk isoc [ 170.952212] em28xx: chip ID is em2840 [
Re: em28xx vb2 warnings
On 07/27/2014 11:17 PM, Frank Schäfer wrote: Am 25.07.2014 21:07, schrieb Hans Verkuil: On 07/25/2014 06:20 PM, Frank Schäfer wrote: Hi Hans, I'm getting the following warnings with the em28xx driver on streaming stop: [ 7597.346168] WARNING: CPU: 1 PID: 3730 at drivers/media/v4l2-core/videobuf2-core.c:2126 __vb2_queue_cancel+0xf5/0x150 [videobuf2_core]() [ 7597.346171] Modules linked in: em28xx_rc snd_usb_audio ov2640 soc_camera soc_mediabus em28xx_v4l videobuf2_core videobuf2_vmalloc videobuf2_memops snd_usbmidi_lib snd_rawmidi em28xx xt_pkttype xt_LOG xt_limit bnep af_packet bluetooth ip6t_REJECT xt_tcpudp nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_raw ipt_REJECT iptable_raw xt_CT iptable_filter ip6table_mangle nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_ipv4 nf_defrag_ipv4 ip_tables xt_conntrack nf_conntrack ip6table_filter ip6_tables x_tables rc_hauppauge ir_kbd_i2c arc4 tuner_simple tuner_types rtl8187 mac80211 tda9887 fuse tda8290 snd_hda_codec_analog tuner snd_hda_codec_hdmi snd_hda_codec_generic sr_mod cdrom snd_hda_intel snd_hda_controller snd_hda_codec msp3400 snd_hwdep cfg80211 bttv snd_pcm v4l2_common snd_seq ppdev powernow_k8 [ 7597.346230] snd_timer snd_seq_device pcspkr videodev serio_raw snd firewire_ohci firewire_core k8temp rfkill eeprom_93cx6 i2c_nforce2 usb_storage videobuf_dma_sg videobuf_core btcx_risc pata_jmicron rc_core usblp soundcore forcedeth crc_itu_t tveeprom ata_generic floppy sata_nv pata_amd asus_atk0110 parport_pc parport button sg dm_mod autofs4 radeon ttm drm_kms_helper drm fan thermal processor thermal_sys i2c_algo_bit scsi_dh_hp_sw scsi_dh_emc scsi_dh_rdac scsi_dh_alua scsi_dh [ 7597.346268] CPU: 1 PID: 3730 Comm: qv4l2 Tainted: GW 3.16.0-rc6-0.1-desktop+ #18 [ 7597.346271] Hardware name: System manufacturer System Product Name [...] [ 7597.346273] e09d9d3c c0780b62 e09d9d6c c0243359 c091deec [ 7597.346279] 0001 0e92 f870a4a4 084e f87054e5 f87054e5 e6905040 e2f61640 [ 7597.346285] ef85f4c8 e09d9d7c c02433ed 0009 e09d9d94 f87054e5 e2ef6550 [ 7597.346290] Call Trace: [ 7597.346300] [c0780b62] dump_stack+0x48/0x69 [ 7597.346305] [c0243359] warn_slowpath_common+0x79/0x90 [ 7597.346312] [f87054e5] ? __vb2_queue_cancel+0xf5/0x150 [videobuf2_core] [ 7597.346318] [f87054e5] ? __vb2_queue_cancel+0xf5/0x150 [videobuf2_core] [ 7597.346322] [c02433ed] warn_slowpath_null+0x1d/0x20 [ 7597.346327] [f87054e5] __vb2_queue_cancel+0xf5/0x150 [videobuf2_core] [ 7597.346333] [f8706b35] vb2_internal_streamoff+0x35/0x90 [videobuf2_core] [ 7597.346338] [c04b7cbb] ? _copy_from_user+0x3b/0x50 [ 7597.346344] [f8706bc5] vb2_streamoff+0x35/0x60 [videobuf2_core] [ 7597.346350] [c0699433] ? __sys_recvmsg+0x43/0x70 [ 7597.346356] [f8706c27] vb2_ioctl_streamoff+0x37/0x40 [videobuf2_core] [ 7597.346371] [f7c56805] v4l_streamoff+0x15/0x20 [videodev] [ 7597.346382] [f7c5962c] __video_do_ioctl+0x1fc/0x280 [videodev] [ 7597.346394] [f7c5908e] video_usercopy+0x1ce/0x550 [videodev] [ 7597.346399] [c038aac7] ? fsnotify+0x1e7/0x2b0 [ 7597.346410] [f7c59422] video_ioctl2+0x12/0x20 [videodev] [ 7597.346421] [f7c59430] ? video_ioctl2+0x20/0x20 [videodev] [ 7597.346430] [f7c55615] v4l2_ioctl+0xe5/0x120 [videodev] [ 7597.346439] [f7c55530] ? v4l2_open+0xf0/0xf0 [videodev] [ 7597.346443] [c03668e2] do_vfs_ioctl+0x2e2/0x4d0 [ 7597.346449] [c0356a3c] ? vfs_write+0x13c/0x1c0 [ 7597.346452] [c03575df] ? vfs_writev+0x2f/0x50 [ 7597.346455] [c0366b28] SyS_ioctl+0x58/0x80 [ 7597.346460] [c07870ec] sysenter_do_call+0x12/0x16 [ 7597.346463] ---[ end trace 16421a251cba8f63 ]--- There have been quite a few vb2 changes recently. Any idea what's wrong ? Could you take a look at this ? What it means is that the driver appears not to have given back all buffers to the vb2 core. I do see that this doesn't happen in start_streaming if an error occurs there (queued buffers should be returned to state DEQUEUED in that case), but stop_streaming seems to return it perfectly fine. If in your test case start_streaming failed, then that would explain it. No, streaming start doesn't fail. The test case is simple: start qv4l2, start streaming, stop streaming. Enable the VIDEO_ADV_DEBUG config option which will dump an overview of the vb2 ops: mismatched counts should be reported. I also enabled em28xx core_debug: Sorry, it will have to wait until Tuesday when I have access to my em28xx device again. Regards, Hans -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
em28xx vb2 warnings
Hi Hans, I'm getting the following warnings with the em28xx driver on streaming stop: [ 7597.346168] WARNING: CPU: 1 PID: 3730 at drivers/media/v4l2-core/videobuf2-core.c:2126 __vb2_queue_cancel+0xf5/0x150 [videobuf2_core]() [ 7597.346171] Modules linked in: em28xx_rc snd_usb_audio ov2640 soc_camera soc_mediabus em28xx_v4l videobuf2_core videobuf2_vmalloc videobuf2_memops snd_usbmidi_lib snd_rawmidi em28xx xt_pkttype xt_LOG xt_limit bnep af_packet bluetooth ip6t_REJECT xt_tcpudp nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_raw ipt_REJECT iptable_raw xt_CT iptable_filter ip6table_mangle nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_ipv4 nf_defrag_ipv4 ip_tables xt_conntrack nf_conntrack ip6table_filter ip6_tables x_tables rc_hauppauge ir_kbd_i2c arc4 tuner_simple tuner_types rtl8187 mac80211 tda9887 fuse tda8290 snd_hda_codec_analog tuner snd_hda_codec_hdmi snd_hda_codec_generic sr_mod cdrom snd_hda_intel snd_hda_controller snd_hda_codec msp3400 snd_hwdep cfg80211 bttv snd_pcm v4l2_common snd_seq ppdev powernow_k8 [ 7597.346230] snd_timer snd_seq_device pcspkr videodev serio_raw snd firewire_ohci firewire_core k8temp rfkill eeprom_93cx6 i2c_nforce2 usb_storage videobuf_dma_sg videobuf_core btcx_risc pata_jmicron rc_core usblp soundcore forcedeth crc_itu_t tveeprom ata_generic floppy sata_nv pata_amd asus_atk0110 parport_pc parport button sg dm_mod autofs4 radeon ttm drm_kms_helper drm fan thermal processor thermal_sys i2c_algo_bit scsi_dh_hp_sw scsi_dh_emc scsi_dh_rdac scsi_dh_alua scsi_dh [ 7597.346268] CPU: 1 PID: 3730 Comm: qv4l2 Tainted: GW 3.16.0-rc6-0.1-desktop+ #18 [ 7597.346271] Hardware name: System manufacturer System Product Name [...] [ 7597.346273] e09d9d3c c0780b62 e09d9d6c c0243359 c091deec [ 7597.346279] 0001 0e92 f870a4a4 084e f87054e5 f87054e5 e6905040 e2f61640 [ 7597.346285] ef85f4c8 e09d9d7c c02433ed 0009 e09d9d94 f87054e5 e2ef6550 [ 7597.346290] Call Trace: [ 7597.346300] [c0780b62] dump_stack+0x48/0x69 [ 7597.346305] [c0243359] warn_slowpath_common+0x79/0x90 [ 7597.346312] [f87054e5] ? __vb2_queue_cancel+0xf5/0x150 [videobuf2_core] [ 7597.346318] [f87054e5] ? __vb2_queue_cancel+0xf5/0x150 [videobuf2_core] [ 7597.346322] [c02433ed] warn_slowpath_null+0x1d/0x20 [ 7597.346327] [f87054e5] __vb2_queue_cancel+0xf5/0x150 [videobuf2_core] [ 7597.346333] [f8706b35] vb2_internal_streamoff+0x35/0x90 [videobuf2_core] [ 7597.346338] [c04b7cbb] ? _copy_from_user+0x3b/0x50 [ 7597.346344] [f8706bc5] vb2_streamoff+0x35/0x60 [videobuf2_core] [ 7597.346350] [c0699433] ? __sys_recvmsg+0x43/0x70 [ 7597.346356] [f8706c27] vb2_ioctl_streamoff+0x37/0x40 [videobuf2_core] [ 7597.346371] [f7c56805] v4l_streamoff+0x15/0x20 [videodev] [ 7597.346382] [f7c5962c] __video_do_ioctl+0x1fc/0x280 [videodev] [ 7597.346394] [f7c5908e] video_usercopy+0x1ce/0x550 [videodev] [ 7597.346399] [c038aac7] ? fsnotify+0x1e7/0x2b0 [ 7597.346410] [f7c59422] video_ioctl2+0x12/0x20 [videodev] [ 7597.346421] [f7c59430] ? video_ioctl2+0x20/0x20 [videodev] [ 7597.346430] [f7c55615] v4l2_ioctl+0xe5/0x120 [videodev] [ 7597.346439] [f7c55530] ? v4l2_open+0xf0/0xf0 [videodev] [ 7597.346443] [c03668e2] do_vfs_ioctl+0x2e2/0x4d0 [ 7597.346449] [c0356a3c] ? vfs_write+0x13c/0x1c0 [ 7597.346452] [c03575df] ? vfs_writev+0x2f/0x50 [ 7597.346455] [c0366b28] SyS_ioctl+0x58/0x80 [ 7597.346460] [c07870ec] sysenter_do_call+0x12/0x16 [ 7597.346463] ---[ end trace 16421a251cba8f63 ]--- There have been quite a few vb2 changes recently. Any idea what's wrong ? Could you take a look at this ? Regards, Frank -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: em28xx vb2 warnings
On 07/25/2014 06:20 PM, Frank Schäfer wrote: Hi Hans, I'm getting the following warnings with the em28xx driver on streaming stop: [ 7597.346168] WARNING: CPU: 1 PID: 3730 at drivers/media/v4l2-core/videobuf2-core.c:2126 __vb2_queue_cancel+0xf5/0x150 [videobuf2_core]() [ 7597.346171] Modules linked in: em28xx_rc snd_usb_audio ov2640 soc_camera soc_mediabus em28xx_v4l videobuf2_core videobuf2_vmalloc videobuf2_memops snd_usbmidi_lib snd_rawmidi em28xx xt_pkttype xt_LOG xt_limit bnep af_packet bluetooth ip6t_REJECT xt_tcpudp nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_raw ipt_REJECT iptable_raw xt_CT iptable_filter ip6table_mangle nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_ipv4 nf_defrag_ipv4 ip_tables xt_conntrack nf_conntrack ip6table_filter ip6_tables x_tables rc_hauppauge ir_kbd_i2c arc4 tuner_simple tuner_types rtl8187 mac80211 tda9887 fuse tda8290 snd_hda_codec_analog tuner snd_hda_codec_hdmi snd_hda_codec_generic sr_mod cdrom snd_hda_intel snd_hda_controller snd_hda_codec msp3400 snd_hwdep cfg80211 bttv snd_pcm v4l2_common snd_seq ppdev powernow_k8 [ 7597.346230] snd_timer snd_seq_device pcspkr videodev serio_raw snd firewire_ohci firewire_core k8temp rfkill eeprom_93cx6 i2c_nforce2 usb_storage videobuf_dma_sg videobuf_core btcx_risc pata_jmicron rc_core usblp soundcore forcedeth crc_itu_t tveeprom ata_generic floppy sata_nv pata_amd asus_atk0110 parport_pc parport button sg dm_mod autofs4 radeon ttm drm_kms_helper drm fan thermal processor thermal_sys i2c_algo_bit scsi_dh_hp_sw scsi_dh_emc scsi_dh_rdac scsi_dh_alua scsi_dh [ 7597.346268] CPU: 1 PID: 3730 Comm: qv4l2 Tainted: GW 3.16.0-rc6-0.1-desktop+ #18 [ 7597.346271] Hardware name: System manufacturer System Product Name [...] [ 7597.346273] e09d9d3c c0780b62 e09d9d6c c0243359 c091deec [ 7597.346279] 0001 0e92 f870a4a4 084e f87054e5 f87054e5 e6905040 e2f61640 [ 7597.346285] ef85f4c8 e09d9d7c c02433ed 0009 e09d9d94 f87054e5 e2ef6550 [ 7597.346290] Call Trace: [ 7597.346300] [c0780b62] dump_stack+0x48/0x69 [ 7597.346305] [c0243359] warn_slowpath_common+0x79/0x90 [ 7597.346312] [f87054e5] ? __vb2_queue_cancel+0xf5/0x150 [videobuf2_core] [ 7597.346318] [f87054e5] ? __vb2_queue_cancel+0xf5/0x150 [videobuf2_core] [ 7597.346322] [c02433ed] warn_slowpath_null+0x1d/0x20 [ 7597.346327] [f87054e5] __vb2_queue_cancel+0xf5/0x150 [videobuf2_core] [ 7597.346333] [f8706b35] vb2_internal_streamoff+0x35/0x90 [videobuf2_core] [ 7597.346338] [c04b7cbb] ? _copy_from_user+0x3b/0x50 [ 7597.346344] [f8706bc5] vb2_streamoff+0x35/0x60 [videobuf2_core] [ 7597.346350] [c0699433] ? __sys_recvmsg+0x43/0x70 [ 7597.346356] [f8706c27] vb2_ioctl_streamoff+0x37/0x40 [videobuf2_core] [ 7597.346371] [f7c56805] v4l_streamoff+0x15/0x20 [videodev] [ 7597.346382] [f7c5962c] __video_do_ioctl+0x1fc/0x280 [videodev] [ 7597.346394] [f7c5908e] video_usercopy+0x1ce/0x550 [videodev] [ 7597.346399] [c038aac7] ? fsnotify+0x1e7/0x2b0 [ 7597.346410] [f7c59422] video_ioctl2+0x12/0x20 [videodev] [ 7597.346421] [f7c59430] ? video_ioctl2+0x20/0x20 [videodev] [ 7597.346430] [f7c55615] v4l2_ioctl+0xe5/0x120 [videodev] [ 7597.346439] [f7c55530] ? v4l2_open+0xf0/0xf0 [videodev] [ 7597.346443] [c03668e2] do_vfs_ioctl+0x2e2/0x4d0 [ 7597.346449] [c0356a3c] ? vfs_write+0x13c/0x1c0 [ 7597.346452] [c03575df] ? vfs_writev+0x2f/0x50 [ 7597.346455] [c0366b28] SyS_ioctl+0x58/0x80 [ 7597.346460] [c07870ec] sysenter_do_call+0x12/0x16 [ 7597.346463] ---[ end trace 16421a251cba8f63 ]--- There have been quite a few vb2 changes recently. Any idea what's wrong ? Could you take a look at this ? What it means is that the driver appears not to have given back all buffers to the vb2 core. I do see that this doesn't happen in start_streaming if an error occurs there (queued buffers should be returned to state DEQUEUED in that case), but stop_streaming seems to return it perfectly fine. If in your test case start_streaming failed, then that would explain it. Enable the VIDEO_ADV_DEBUG config option which will dump an overview of the vb2 ops: mismatched counts should be reported. I'm not sure if I can test this this weekend: I have two em28xx devices, one is at work, the other is a Hauppauge 930C, but the analog support for that one is missing in the driver (even though it still creates a video node!). It will probably be Tuesday evening before I can test. Regards, Hans -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html