1. 05 Jan, 2018 15 commits
  2. 04 Jan, 2018 11 commits
  3. 03 Jan, 2018 11 commits
    • Mauro Carvalho Chehab's avatar
      media: vb2: add a new warning about pending buffers · 6f0e5fd3
      Mauro Carvalho Chehab authored
      There's a logic at the VB2 core that produces a WARN_ON if
      there are still buffers waiting to be filled. However, it doesn't
      indicate what buffers are still opened, with makes harder to
      identify issues inside caller drivers.
      
      So, add a new pr_warn() pointing to such buffers. That, together
      with debug instrumentation inside the drivers can make easier to
      identify where the problem is.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      6f0e5fd3
    • Mauro Carvalho Chehab's avatar
      media: vb2: add pr_fmt() macro · 2e33dbb0
      Mauro Carvalho Chehab authored
      Simplify the pr_foo() macros by adding a pr_fmt() macro.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      2e33dbb0
    • Satendra Singh Thakur's avatar
      media: vb2: Fix a bug about unnecessary calls to queue cancel and free · ce468670
      Satendra Singh Thakur authored
      Currently, there's a logic with checks if *count is non-zero,
      q->num_buffers is zero and q->memory is different than memory.
      
      That's flawed when the device is initialized, or after the
      queues are freed, as it does, unnecessary calls to
      __vb2_queue_cancel() and  __vb2_queue_free().
      
      That can be avoided by making sure that q->memory is set to
      VB2_MEMORY_UNKNOWN at vb2_core_queue_init(), and adding such
      check at the loop.
      
      [mchehab@s-opensource.com: fix checkpatch issues and improve the
       patch, by setting q->memory to zero at vb2_core_queue_init]
      Signed-off-by: default avatarSatendra Singh Thakur <satendra.t@samsung.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      ce468670
    • Sakari Ailus's avatar
      media: vb2: Enforce VB2_MAX_FRAME in vb2_core_reqbufs better · 0097ff8e
      Sakari Ailus authored
      The check for the number of buffers requested against the maximum,
      VB2_MAX_FRAME, was performed before checking queue's minimum number of
      buffers. Reverse the order, thus ensuring that under no circumstances
      num_buffers exceeds VB2_MAX_FRAME here.
      
      Also add a warning of the condition.
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      0097ff8e
    • Mauro Carvalho Chehab's avatar
      media: videobuf2-core: don't go out of the buffer range · df93dc61
      Mauro Carvalho Chehab authored
      Currently, there's no check if an invalid buffer range
      is passed. However, while testing DVB memory mapped apps,
      I got this:
      
         videobuf2_core: VB: num_buffers -2143943680, buffer 33, index -2143943647
         unable to handle kernel paging request at ffff888b773c0890
         IP: __vb2_queue_alloc+0x134/0x4e0 [videobuf2_core]
         PGD 4142c7067 P4D 4142c7067 PUD 0
         Oops: 0002 [#1] SMP
         Modules linked in: xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack tun bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables bluetooth rfkill ecdh_generic binfmt_misc rc_dvbsky sp2 ts2020 intel_rapl x86_pkg_temp_thermal dvb_usb_dvbsky intel_powerclamp dvb_usb_v2 coretemp m88ds3103 kvm_intel i2c_mux dvb_core snd_hda_codec_hdmi crct10dif_pclmul crc32_pclmul videobuf2_vmalloc videobuf2_memops snd_hda_intel ghash_clmulni_intel videobuf2_core snd_hda_codec rc_core mei_me intel_cstate snd_hwdep snd_hda_core videodev intel_uncore snd_pcm mei media tpm_tis tpm_tis_core intel_rapl_perf tpm snd_timer lpc_ich snd soundcore kvm irqbypass libcrc32c i915 i2c_algo_bit drm_kms_helper
         e1000e ptp drm crc32c_intel video pps_core
         CPU: 3 PID: 1776 Comm: dvbv5-zap Not tainted 4.14.0+ #78
         Hardware name:                  /NUC5i7RYB, BIOS RYBDWi35.86A.0364.2017.0511.0949 05/11/2017
         task: ffff88877c73bc80 task.stack: ffffb7c402418000
         RIP: 0010:__vb2_queue_alloc+0x134/0x4e0 [videobuf2_core]
         RSP: 0018:ffffb7c40241bc60 EFLAGS: 00010246
         RAX: 0000000080360421 RBX: 0000000000000021 RCX: 000000000000000a
         RDX: ffffb7c40241bcf4 RSI: ffff888780362c60 RDI: ffff888796d8e130
         RBP: ffffb7c40241bcc8 R08: 0000000000000316 R09: 0000000000000004
         R10: ffff888780362c00 R11: 0000000000000001 R12: 000000000002f000
         R13: ffff8887758be700 R14: 0000000000021000 R15: 0000000000000001
         FS:  00007f2849024740(0000) GS:ffff888796d80000(0000) knlGS:0000000000000000
         CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
         CR2: ffff888b773c0890 CR3: 000000043beb2005 CR4: 00000000003606e0
         Call Trace:
          vb2_core_reqbufs+0x226/0x420 [videobuf2_core]
          dvb_vb2_reqbufs+0x2d/0xc0 [dvb_core]
          dvb_dvr_do_ioctl+0x98/0x1d0 [dvb_core]
          dvb_usercopy+0x53/0x1b0 [dvb_core]
          ? dvb_demux_ioctl+0x20/0x20 [dvb_core]
          ? tty_ldisc_deref+0x16/0x20
          ? tty_write+0x1f9/0x310
          ? process_echoes+0x70/0x70
          dvb_dvr_ioctl+0x15/0x20 [dvb_core]
          do_vfs_ioctl+0xa5/0x600
          SyS_ioctl+0x79/0x90
          entry_SYSCALL_64_fastpath+0x1a/0xa5
         RIP: 0033:0x7f28486f7ea7
         RSP: 002b:00007ffc13b2db18 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
         RAX: ffffffffffffffda RBX: 000055b10fc06130 RCX: 00007f28486f7ea7
         RDX: 00007ffc13b2db48 RSI: 00000000c0086f3c RDI: 0000000000000007
         RBP: 0000000000000203 R08: 000055b10df1e02c R09: 000000000000002e
         R10: 0036b42415108357 R11: 0000000000000246 R12: 0000000000000000
         R13: 00007f2849062f60 R14: 00000000000001f1 R15: 00007ffc13b2da54
         Code: 74 0a 60 8b 0a 48 83 c0 30 48 83 c2 04 89 48 d0 89 48 d4 48 39 f0 75 eb 41 8b 42 08 83 7d d4 01 41 c7 82 ec 01 00 00 ff ff ff ff <4d> 89 94 c5 88 00 00 00 74 14 83 c3 01 41 39 dc 0f 85 f1 fe ff
         RIP: __vb2_queue_alloc+0x134/0x4e0 [videobuf2_core] RSP: ffffb7c40241bc60
         CR2: ffff888b773c0890
      
      So, add a sanity check in order to prevent going past array.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      df93dc61
    • Julia Lawall's avatar
      media: pvrusb2: drop unneeded newline · 510bb915
      Julia Lawall authored
      pvr2_trace prints a newline at the end of the message string, so the
      message string does not need to include a newline explicitly.  Done
      using Coccinelle.
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      510bb915
    • Daniel Scheller's avatar
      media: dvb-frontends/stv0910: cleanup init_search_param() and enable PLS · 6392bc2e
      Daniel Scheller authored
      Cleanup the mess in init_search_param() by utilising the new register
      access macros and functions. And while at it, move the ISI and PLS setup
      into separate functions, and pass the new scrambling_sequence_index (aka.
      physical layer scrambling) value to set_pls.
      
      Picked up from the dddvb upstream, adapted to the different naming of the
      pls property (pls vs. scrambling_sequence_index).
      
      Cc: Ralph Metzler <rjkm@metzlerbros.de>
      Signed-off-by: default avatarDaniel Scheller <d.scheller@gmx.net>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      6392bc2e
    • Daniel Scheller's avatar
      media: dvb-frontends/stv0910: field and register access helpers · bdd7682b
      Daniel Scheller authored
      Add a write_field() function that acts as helper to update specific bits
      specified in the field defines (FSTV0910_*) in stv0910_regs.h, which was
      recently updated to carry the missing offset values. With that, add the
      SET_FIELD(), SET_REG() and GET_REG() macros that wrap the write_field(),
      write_reg() and read_reg() functions to allow for making all demod
      access code cleaner.
      
      The write_field() function is annotated with __maybe_unused temporarily
      to silence eventual compile warnings.
      
      Picked up from the dddvb upstream, with the macro names made uppercase
      so they are distinguishable as such.
      
      Cc: Ralph Metzler <rjkm@metzlerbros.de>
      Signed-off-by: default avatarDaniel Scheller <d.scheller@gmx.net>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      bdd7682b
    • Daniel Scheller's avatar
      media: dvb-frontends/stv0910: cleanup I2C access functions · 8042e98c
      Daniel Scheller authored
      write_reg() and i2c_write_reg16() only act as a proxy to i2c_write(), which
      isn't called from anywhere else throughout the driver. Clean this up by
      moving the message setup and the i2c_transfer() into write_reg() so it
      becomes the only I2C write function. While touching those parts, fix the
      error codes from EREMOTEIO to EIO.
      
      The I2C cleanup is picked from the upstream dddvb.
      
      Cc: Ralph Metzler <rjkm@metzlerbros.de>
      Signed-off-by: default avatarDaniel Scheller <d.scheller@gmx.net>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      8042e98c
    • Daniel Scheller's avatar
      media: dvb-frontends/stv0910: deduplicate writes in enable_puncture_rate() · 4b596bd7
      Daniel Scheller authored
      For all code rates, the same write is performed, only with a differing
      value. Clean this up by putting that value into a variable instead and
      perform the write at the end with that value.
      
      Picked up from the dddvb upstream.
      
      Cc: Ralph Metzler <rjkm@metzlerbros.de>
      Signed-off-by: default avatarDaniel Scheller <d.scheller@gmx.net>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      4b596bd7
    • Mauro Carvalho Chehab's avatar
      Merge tag 'v4.15-rc6' into patchwork · 3bdf481e
      Mauro Carvalho Chehab authored
      Linux 4.15-rc6
      
      * tag 'v4.15-rc6': (734 commits)
        Linux 4.15-rc6
        MAINTAINERS: mark arch/blackfin/ and its gubbins as orphaned
        x86/ldt: Make LDT pgtable free conditional
        x86/ldt: Plug memory leak in error path
        x86/mm: Remove preempt_disable/enable() from __native_flush_tlb()
        x86/smpboot: Remove stale TLB flush invocations
        objtool: Fix seg fault with clang-compiled objects
        objtool: Fix seg fault caused by missing parameter
        kbuild: add '-fno-stack-check' to kernel build options
        timerqueue: Document return values of timerqueue_add/del()
        timers: Invoke timer_start_debug() where it makes sense
        nohz: Prevent a timer interrupt storm in tick_nohz_stop_sched_tick()
        timers: Reinitialize per cpu bases on hotplug
        timers: Use deferrable base independent of base::nohz_active
        genirq/msi, x86/vector: Prevent reservation mode for non maskable MSI
        genirq/irqdomain: Rename early argument of irq_domain_activate_irq()
        x86/vector: Use IRQD_CAN_RESERVE flag
        genirq: Introduce IRQD_CAN_RESERVE flag
        genirq/msi: Handle reactivation only on success
        gpio: brcmstb: Make really use of the new lockdep class
        ...
      3bdf481e
  4. 31 Dec, 2017 3 commits
    • Linus Torvalds's avatar
      Linux 4.15-rc6 · 30a7acd5
      Linus Torvalds authored
      30a7acd5
    • Linus Torvalds's avatar
      Merge branch 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f39d7d78
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A couple of fixlets for x86:
      
         - Fix the ESPFIX double fault handling for 5-level pagetables
      
         - Fix the commandline parsing for 'apic=' on 32bit systems and update
           documentation
      
         - Make zombie stack traces reliable
      
         - Fix kexec with stack canary
      
         - Fix the delivery mode for APICs which was missed when the x86
           vector management was converted to single target delivery. Caused a
           regression due to the broken hardware which ignores affinity
           settings in lowest prio delivery mode.
      
         - Unbreak modules when AMD memory encryption is enabled
      
         - Remove an unused parameter of prepare_switch_to"
      
      * 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/apic: Switch all APICs to Fixed delivery mode
        x86/apic: Update the 'apic=' description of setting APIC driver
        x86/apic: Avoid wrong warning when parsing 'apic=' in X86-32 case
        x86-32: Fix kexec with stack canary (CONFIG_CC_STACKPROTECTOR)
        x86: Remove unused parameter of prepare_switch_to
        x86/stacktrace: Make zombie stack traces reliable
        x86/mm: Unbreak modules that use the DMA API
        x86/build: Make isoimage work on Debian
        x86/espfix/64: Fix espfix double-fault handling on 5-level systems
      f39d7d78
    • Linus Torvalds's avatar
      Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 52c90f2d
      Linus Torvalds authored
      Pull x86 page table isolation fixes from Thomas Gleixner:
       "Four patches addressing the PTI fallout as discussed and debugged
        yesterday:
      
         - Remove stale and pointless TLB flush invocations from the hotplug
           code
      
         - Remove stale preempt_disable/enable from __native_flush_tlb()
      
         - Plug the memory leak in the write_ldt() error path"
      
      * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/ldt: Make LDT pgtable free conditional
        x86/ldt: Plug memory leak in error path
        x86/mm: Remove preempt_disable/enable() from __native_flush_tlb()
        x86/smpboot: Remove stale TLB flush invocations
      52c90f2d