1. 28 Dec, 2017 3 commits
    • Mauro Carvalho Chehab's avatar
      media: dvb_vb2: limit reqbufs size to a sane value · 2c06aa7c
      Mauro Carvalho Chehab authored
      It is not a good idea to let users to request a very high buffer
      size.
      
      So, add an upper limit.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      2c06aa7c
    • Mauro Carvalho Chehab's avatar
      media: dvb_vb2: fix a warning about streamoff logic · 7b6c96d5
      Mauro Carvalho Chehab authored
      The streamoff logic is causing those warnings:
      
       WARNING: CPU: 3 PID: 3382 at drivers/media/v4l2-core/videobuf2-core.c:1652 __vb2_queue_cancel+0x177/0x250 [videobuf2_core]
       Modules linked in: bnep fuse xt_CHECKSUM iptable_mangle tun ebtable_filter ebtables ip6table_filter ip6_tables xt_physdev br_netfilter bluetooth bridge rfkill ecdh_generic stp llc nf_log_ipv4 nf_log_common xt_LOG xt_conntrack ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack libcrc32c sunrpc vfat fat snd_hda_codec_hdmi rc_dib0700_nec i915 rc_pinnacle_pctv_hd em28xx_rc a8293 ts2020 m88ds3103 i2c_mux em28xx_dvb dib8000 dvb_usb_dib0700 dib0070 dib7000m dib0090 dvb_usb dvb_core uvcvideo snd_usb_audio videobuf2_v4l2 dib3000mc videobuf2_vmalloc videobuf2_memops dibx000_common videobuf2_core rc_core snd_usbmidi_lib snd_rawmidi em28xx tveeprom v4l2_common videodev media intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_intel
       kvm_intel snd_hda_codec kvm snd_hwdep snd_hda_core snd_seq irqbypass crct10dif_pclmul crc32_pclmul i2c_algo_bit ghash_clmulni_intel snd_seq_device drm_kms_helper snd_pcm intel_cstate intel_uncore snd_timer tpm_tis drm mei_wdt iTCO_wdt iTCO_vendor_support tpm_tis_core snd intel_rapl_perf mei_me mei tpm i2c_i801 soundcore lpc_ich video binfmt_misc hid_logitech_hidpp hid_logitech_dj e1000e crc32c_intel ptp pps_core analog gameport joydev
       CPU: 3 PID: 3382 Comm: lt-dvbv5-zap Not tainted 4.14.0+ #3
       Hardware name:                  /D53427RKE, BIOS RKPPT10H.86A.0048.2017.0506.1545 05/06/2017
       task: ffff94b93bbe1e40 task.stack: ffffb7a98320c000
       RIP: 0010:__vb2_queue_cancel+0x177/0x250 [videobuf2_core]
       RSP: 0018:ffffb7a98320fd40 EFLAGS: 00010202
       RAX: 0000000000000001 RBX: ffff94b92ff72428 RCX: 0000000000000000
       RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff94b92ff72428
       RBP: ffffb7a98320fd68 R08: ffff94b92ff725d8 R09: ffffb7a98320fcc8
       R10: ffff94b978003d98 R11: ffff94b92ff72428 R12: ffff94b92ff72428
       R13: 0000000000000282 R14: ffff94b92059ae20 R15: dead000000000100
       FS:  0000000000000000(0000) GS:ffff94b99e380000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 0000555953007d70 CR3: 000000012be09004 CR4: 00000000001606e0
       Call Trace:
        vb2_core_streamoff+0x28/0x90 [videobuf2_core]
        dvb_vb2_stream_off+0xd1/0x150 [dvb_core]
        dvb_dvr_release+0x114/0x120 [dvb_core]
        __fput+0xdf/0x1e0
        ____fput+0xe/0x10
        task_work_run+0x94/0xc0
        do_exit+0x2dc/0xba0
        do_group_exit+0x47/0xb0
        SyS_exit_group+0x14/0x20
        entry_SYSCALL_64_fastpath+0x1a/0xa5
       RIP: 0033:0x7f775e931ed8
       RSP: 002b:00007fff07019d68 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
       RAX: ffffffffffffffda RBX: 0000000001d02690 RCX: 00007f775e931ed8
       RDX: 0000000000000001 RSI: 000000000000003c RDI: 0000000000000001
       RBP: 00007fff0701a500 R08: 00000000000000e7 R09: ffffffffffffff70
       R10: 00007f775e854dd8 R11: 0000000000000246 R12: 0000000000000000
       R13: 00000000035fa000 R14: 000000000000000a R15: 000000000000000a
       Code: 00 00 04 74 1c 44 89 e8 49 83 c5 01 41 39 84 24 88 01 00 00 77 8a 5b 41 5c 41 5d 41 5e 41 5f 5d c3 48 89 df e8 bb fd ff ff eb da <0f> ff 41 8b b4 24 88 01 00 00 85 f6 74 34 bb 01 00 00 00 eb 10
      
      There are actually two issues here:
      
      1) list_del() should be called when changing the buffer state;
      
      2) The logic with marks the buffers as done is at the wrong place.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      7b6c96d5
    • Satendra Singh Thakur's avatar
      media: videobuf2: Add new uAPI for DVB streaming I/O · 57868acc
      Satendra Singh Thakur authored
      Adds a new uAPI for DVB to use streaming I/O which is implemented
      based on videobuf2, using those new ioctls:
      
      - DMX_REQBUFS:  Request kernel to allocate buffers which count and size
      	        are dedicated by user.
      - DMX_QUERYBUF: Get the buffer information like a memory offset which
      		will mmap() and be shared with user-space.
      - DMX_EXPBUF:   Just for testing whether buffer-exporting success or not.
      - DMX_QBUF:     Pass the buffer to kernel-space.
      - DMX_DQBUF:    Get back the buffer which may contain TS data.
      
      Originally developed by: Junghak Sung <jh1009.sung@samsung.com>, as
      seen at:
      	https://patchwork.linuxtv.org/patch/31613/
      	https://patchwork.kernel.org/patch/7334301/
      
      The original patch was written before merging VB2-core functionalities
      upstream. When such series was added, several adjustments were made,
      fixing some issues with	V4L2, causing the original patch to be
      non-trivially rebased.
      
      After rebased, a few bugs in the patch were fixed. The patch was
      also enhanced it and polling functionality got added.
      
      The main changes over the original patch are:
      
      dvb_vb2_fill_buffer():
      	- Set the size of the outgoing buffer after while loop using
      	  vb2_set_plane_payload;
      
      	- Added NULL check for source buffer as per normal convention
      	  of demux driver, this is called twice, first time with valid
      	  buffer second time with NULL pointer, if its not handled,
      	  it will result in  crash
      
      	- Restricted spinlock for only list_* operations
      
      dvb_vb2_init():
      	- Restricted q->io_modes to only VB2_MMAP as its the only
      	  supported mode
      
      dvb_vb2_release():
      	- Replaced the && in if condiion with &, because otherwise
      	  it was always getting satisfied.
      
      dvb_vb2_stream_off():
      	- Added list_del code for enqueud buffers upon stream off
      
      dvb_vb2_poll():
      	- Added this new function in order to support polling
      
      dvb_demux_poll() and dvb_dvr_poll()
      	- dvb_vb2_poll() is now called from these functions
      
      - Ported this patch and latest videobuf2 to lower kernel versions and
        tested auto scan.
      Co-developed-by: default avatarJunghak Sung <jh1009.sung@samsung.com>
      
      [mchehab@s-opensource.com: checkpatch fixes]
      Signed-off-by: default avatarJunghak Sung <jh1009.sung@samsung.com>
      Signed-off-by: default avatarGeunyoung Kim <nenggun.kim@samsung.com>
      Acked-by: default avatarSeung-Woo Kim <sw0312.kim@samsung.com>
      Acked-by: default avatarInki Dae <inki.dae@samsung.com>
      Signed-off-by: default avatarSatendra Singh Thakur <satendra.t@samsung.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      57868acc
  2. 22 Dec, 2017 1 commit
    • Mauro Carvalho Chehab's avatar
      Merge branch 'docs-next' of git://git.lwn.net/linux into patchwork · 9eb124fe
      Mauro Carvalho Chehab authored
      * 'docs-next' of git://git.lwn.net/linux: (888 commits)
        w1_netlink.h: add support for nested structs
        scripts: kernel-doc: apply filtering rules to warnings
        scripts: kernel-doc: improve nested logic to handle multiple identifiers
        scripts: kernel-doc: handle nested struct function arguments
        scripts: kernel-doc: print the declaration name on warnings
        scripts: kernel-doc: get rid of $nested parameter
        scripts: kernel-doc: parse next structs/unions
        scripts: kernel-doc: replace tabs by spaces
        scripts: kernel-doc: change default to ReST format
        scripts: kernel-doc: improve argument handling
        scripts: kernel-doc: get rid of unused output formats
        docs: get rid of kernel-doc-nano-HOWTO.txt
        docs: kernel-doc.rst: add documentation about man pages
        docs: kernel-doc.rst: improve typedef documentation
        docs: kernel-doc.rst: improve structs chapter
        docs: kernel-doc.rst: improve function documentation section
        docs: kernel-doc.rst: improve private members description
        docs: kernel-doc.rst: better describe kernel-doc arguments
        docs: fix process/submit-checklist.rst Sphinx warning
        docs: ftrace-uses.rst fix varios code-block directives
        ...
      9eb124fe
  3. 21 Dec, 2017 31 commits
  4. 19 Dec, 2017 5 commits