19 Oct, 2016

4 commits

  • Merge the gup_flags cleanups from Lorenzo Stoakes:
    "This patch series adjusts functions in the get_user_pages* family such
    that desired FOLL_* flags are passed as an argument rather than
    implied by flags.

    The purpose of this change is to make the use of FOLL_FORCE explicit
    so it is easier to grep for and clearer to callers that this flag is
    being used. The use of FOLL_FORCE is an issue as it overrides missing
    VM_READ/VM_WRITE flags for the VMA whose pages we are reading
    from/writing to, which can result in surprising behaviour.

    The patch series came out of the discussion around commit 38e088546522
    ("mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing"),
    which addressed a BUG_ON() being triggered when a page was faulted in
    with PROT_NONE set but having been overridden by FOLL_FORCE.
    do_numa_page() was run on the assumption the page _must_ be one marked
    for NUMA node migration as an actual PROT_NONE page would have been
    dealt with prior to this code path, however FOLL_FORCE introduced a
    situation where this assumption did not hold.

    See

    https://marc.info/?l=linux-mm&m=147585445805166

    for the patch proposal"

    Additionally, there's a fix for an ancient bug related to FOLL_FORCE and
    FOLL_WRITE by me.

    [ This branch was rebased recently to add a few more acked-by's and
    reviewed-by's ]

    * gup_flag-cleanups:
    mm: replace access_process_vm() write parameter with gup_flags
    mm: replace access_remote_vm() write parameter with gup_flags
    mm: replace __access_remote_vm() write parameter with gup_flags
    mm: replace get_user_pages_remote() write/force parameters with gup_flags
    mm: replace get_user_pages() write/force parameters with gup_flags
    mm: replace get_vaddr_frames() write/force parameters with gup_flags
    mm: replace get_user_pages_locked() write/force parameters with gup_flags
    mm: replace get_user_pages_unlocked() write/force parameters with gup_flags
    mm: remove write/force parameters from __get_user_pages_unlocked()
    mm: remove write/force parameters from __get_user_pages_locked()
    mm: remove gup_flags FOLL_WRITE games from __get_user_pages()

    Linus Torvalds
     
  • This removes the 'write' and 'force' from get_user_pages() and replaces
    them with 'gup_flags' to make the use of FOLL_FORCE explicit in callers
    as use of this flag can result in surprising behaviour (and hence bugs)
    within the mm subsystem.

    Signed-off-by: Lorenzo Stoakes
    Acked-by: Christian König
    Acked-by: Jesper Nilsson
    Acked-by: Michal Hocko
    Reviewed-by: Jan Kara
    Signed-off-by: Linus Torvalds

    Lorenzo Stoakes
     
  • This removes the 'write' and 'force' from get_vaddr_frames() and
    replaces them with 'gup_flags' to make the use of FOLL_FORCE explicit in
    callers as use of this flag can result in surprising behaviour (and
    hence bugs) within the mm subsystem.

    Signed-off-by: Lorenzo Stoakes
    Acked-by: Michal Hocko
    Reviewed-by: Jan Kara
    Signed-off-by: Linus Torvalds

    Lorenzo Stoakes
     
  • This removes the 'write' and 'force' use from get_user_pages_unlocked()
    and replaces them with 'gup_flags' to make the use of FOLL_FORCE
    explicit in callers as use of this flag can result in surprising
    behaviour (and hence bugs) within the mm subsystem.

    Signed-off-by: Lorenzo Stoakes
    Reviewed-by: Jan Kara
    Acked-by: Michal Hocko
    Signed-off-by: Linus Torvalds

    Lorenzo Stoakes
     

15 Oct, 2016

1 commit

  • …/kernel/git/shuah/linux-kselftest

    Pull kselftest updates from Shuah Khan:
    "This update consists of:

    - Fixes and improvements to existing tests

    - Moving code from Documentation to selftests, samples, and tools:

    * Moves dnotify_test, prctl, ptp, vDSO, ia64, watchdog, and
    networking tests from Documentation to selftests.

    * Moves mic/mpssd, misc-devices/mei, timers, watchdog, auxdisplay,
    and blackfin examples from Documentation to samples.

    * Moves accounting, laptops/dslm, and pcmcia/crc32hash tools from
    Documentation to tools.

    * Deletes BUILD_DOCSRC and its dependencies"

    * tag 'linux-kselftest-4.9-rc1-update' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (21 commits)
    selftests/futex: Check ANSI terminal color support
    Doc: update 00-INDEX files to reflect the runnable code move
    samples: move blackfin gptimers-example from Documentation
    tools: move pcmcia crc32hash tool from Documentation
    tools: move laptops dslm tool from Documentation
    tools: move accounting tool from Documentation
    samples: move auxdisplay example code from Documentation
    samples: move watchdog example code from Documentation
    samples: move timers example code from Documentation
    samples: move misc-devices/mei example code from Documentation
    samples: move mic/mpssd example code from Documentation
    selftests: Move networking/timestamping from Documentation
    selftests: move watchdog tests from Documentation/watchdog
    selftests: move ia64 tests from Documentation/ia64
    selftests: move vDSO tests from Documentation/vDSO
    selftests: move ptp tests from Documentation/ptp
    selftests: move prctl tests from Documentation/prctl
    selftests: move dnotify_test from Documentation/filesystems
    selftests/timers: Add missing error code assignment before test
    selftests/zram: replace ZRAM_LZ4_COMPRESS
    ...

    Linus Torvalds
     

12 Oct, 2016

4 commits

  • Merge more updates from Andrew Morton:

    - a few block updates that fell in my lap

    - lib/ updates

    - checkpatch

    - autofs

    - ipc

    - a ton of misc other things

    * emailed patches from Andrew Morton : (100 commits)
    mm: split gfp_mask and mapping flags into separate fields
    fs: use mapping_set_error instead of opencoded set_bit
    treewide: remove redundant #include
    hung_task: allow hung_task_panic when hung_task_warnings is 0
    kthread: add kerneldoc for kthread_create()
    kthread: better support freezable kthread workers
    kthread: allow to modify delayed kthread work
    kthread: allow to cancel kthread work
    kthread: initial support for delayed kthread work
    kthread: detect when a kthread work is used by more workers
    kthread: add kthread_destroy_worker()
    kthread: add kthread_create_worker*()
    kthread: allow to call __kthread_create_on_node() with va_list args
    kthread/smpboot: do not park in kthread_create_on_cpu()
    kthread: kthread worker API cleanup
    kthread: rename probe_kthread_data() to kthread_probe_data()
    scripts/tags.sh: enable code completion in VIM
    mm: kmemleak: avoid using __va() on addresses that don't have a lowmem mapping
    kdump, vmcoreinfo: report memory sections virtual addresses
    ipc/sem.c: add cond_resched in exit_sme
    ...

    Linus Torvalds
     
  • Kernel source files need not include explicitly
    because the top Makefile forces to include it with:

    -include $(srctree)/include/linux/kconfig.h

    This commit removes explicit includes except the following:

    * arch/s390/include/asm/facilities_src.h
    * tools/testing/radix-tree/linux/kernel.h

    These two are used for host programs.

    Link: http://lkml.kernel.org/r/1473656164-11929-1-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     
  • A good practice is to prefix the names of functions by the name
    of the subsystem.

    The kthread worker API is a mix of classic kthreads and workqueues. Each
    worker has a dedicated kthread. It runs a generic function that process
    queued works. It is implemented as part of the kthread subsystem.

    This patch renames the existing kthread worker API to use
    the corresponding name from the workqueues API prefixed by
    kthread_:

    __init_kthread_worker() -> __kthread_init_worker()
    init_kthread_worker() -> kthread_init_worker()
    init_kthread_work() -> kthread_init_work()
    insert_kthread_work() -> kthread_insert_work()
    queue_kthread_work() -> kthread_queue_work()
    flush_kthread_work() -> kthread_flush_work()
    flush_kthread_worker() -> kthread_flush_worker()

    Note that the names of DEFINE_KTHREAD_WORK*() macros stay
    as they are. It is common that the "DEFINE_" prefix has
    precedence over the subsystem names.

    Note that INIT() macros and init() functions use different
    naming scheme. There is no good solution. There are several
    reasons for this solution:

    + "init" in the function names stands for the verb "initialize"
    aka "initialize worker". While "INIT" in the macro names
    stands for the noun "INITIALIZER" aka "worker initializer".

    + INIT() macros are used only in DEFINE() macros

    + init() functions are used close to the other kthread()
    functions. It looks much better if all the functions
    use the same scheme.

    + There will be also kthread_destroy_worker() that will
    be used close to kthread_cancel_work(). It is related
    to the init() function. Again it looks better if all
    functions use the same naming scheme.

    + there are several precedents for such init() function
    names, e.g. amd_iommu_init_device(), free_area_init_node(),
    jump_label_init_type(), regmap_init_mmio_clk(),

    + It is not an argument but it was inconsistent even before.

    [arnd@arndb.de: fix linux-next merge conflict]
    Link: http://lkml.kernel.org/r/20160908135724.1311726-1-arnd@arndb.de
    Link: http://lkml.kernel.org/r/1470754545-17632-3-git-send-email-pmladek@suse.com
    Suggested-by: Andrew Morton
    Signed-off-by: Petr Mladek
    Cc: Oleg Nesterov
    Cc: Tejun Heo
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: "Paul E. McKenney"
    Cc: Josh Triplett
    Cc: Thomas Gleixner
    Cc: Jiri Kosina
    Cc: Borislav Petkov
    Cc: Michal Hocko
    Cc: Vlastimil Babka
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Petr Mladek
     
  • Pull media updates from Mauro Carvalho Chehab:

    - Documentation improvements: conversion of all non-DocBook documents
    to Sphinx and lots of fixes to the uAPI media book

    - New PCI driver for Techwell TW5864 media grabber boards

    - New SoC driver for ATMEL Image Sensor Controller

    - Removal of some obsolete SoC drivers (s5p-tv driver and soc_camera
    drivers)

    - Addition of ST CEC driver

    - Lots of drivers fixes, improvements and additions

    * tag 'media/v4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (464 commits)
    [media] ttusb_dec: avoid the risk of go past buffer
    [media] cx23885: Fix some smatch warnings
    [media] si2165: switch to regmap
    [media] si2165: use i2c_client->dev instead of i2c_adapter->dev for logging
    [media] si2165: Remove legacy attach
    [media] cx231xx: attach si2165 driver via i2c_client
    [media] cx231xx: Prepare for attaching new style i2c_client DVB demod drivers
    [media] cx23885: attach si2165 driver via i2c_client
    [media] si2165: support i2c_client attach
    [media] si2165: avoid division by zero
    [media] rcar-vin: add R-Car gen2 fallback compatibility string
    [media] lgdt3306a: remove 20*50 msec unnecessary timeout
    [media] cx25821: Remove deprecated create_singlethread_workqueue
    [media] cx25821: Drop Freeing of Workqueue
    [media] cxd2841er: force 8MHz bandwidth for DVB-C if specified bw not supported
    [media] redrat3: hardware-specific parameters
    [media] redrat3: remove hw_timeout member
    [media] cxd2841er: BER and SNR reading for ISDB-T
    [media] dvb-usb: avoid link error with dib3000m{b,c|
    [media] dvb-usb: split out common parts of dibusb
    ...

    Linus Torvalds
     

10 Oct, 2016

1 commit

  • Move blackfin gptimers-example to samples and remove it from Documentation
    Makefile. Update samples Kconfig and Makefile to build gptimers-example.

    blackfin is the last CONFIG_BUILD_DOCSRC target in Documentation/Makefile.
    Hence this patch also includes changes to remove CONFIG_BUILD_DOCSRC from
    Makefile and lib/Kconfig.debug and updates VIDEO_PCI_SKELETON dependency
    on BUILD_DOCSRC.

    Documentation/Makefile is not deleted to avoid braking make htmldocs and
    make distclean.

    Acked-by: Michal Marek
    Acked-by: Jonathan Corbet
    Reviewed-by: Kees Cook
    Reported-by: Valentin Rothberg
    Reported-by: Paul Gortmaker
    Signed-off-by: Shuah Khan

    Shuah Khan
     

08 Oct, 2016

1 commit

  • Pull ARM SoC driver updates from Arnd Bergmann:
    "Driver updates for ARM SoCs, including a couple of newly added
    drivers:

    - The Qualcomm external bus interface 2 (EBI2), used in some of their
    mobile phone chips for connecting flash memory, LCD displays or
    other peripherals

    - Secure monitor firmware for Amlogic SoCs, and an NVMEM driver for
    the EFUSE based on that firmware interface.

    - Perf support for the AppliedMicro X-Gene performance monitor unit

    - Reset driver for STMicroelectronics STM32

    - Reset driver for SocioNext UniPhier SoCs

    Aside from these, there are minor updates to SoC-specific bus,
    clocksource, firmware, pinctrl, reset, rtc and pmic drivers"

    * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (50 commits)
    bus: qcom-ebi2: depend on HAS_IOMEM
    pinctrl: mvebu: orion5x: Generalise mv88f5181l support for 88f5181
    clk: mvebu: Add clk support for the orion5x SoC mv88f5181
    dt-bindings: EXYNOS: Add Exynos5433 PMU compatible
    clocksource: exynos_mct: Add the support for ARM64
    perf: xgene: Add APM X-Gene SoC Performance Monitoring Unit driver
    Documentation: Add documentation for APM X-Gene SoC PMU DTS binding
    MAINTAINERS: Add entry for APM X-Gene SoC PMU driver
    bus: qcom: add EBI2 driver
    bus: qcom: add EBI2 device tree bindings
    rtc: rtc-pm8xxx: Add support for pm8018 rtc
    nvmem: amlogic: Add Amlogic Meson EFUSE driver
    firmware: Amlogic: Add secure monitor driver
    soc: qcom: smd: Reset rx tail rather than tx
    memory: atmel-sdramc: fix a possible NULL dereference
    reset: hi6220: allow to compile test driver on other architectures
    reset: zynq: add driver Kconfig option
    reset: sunxi: add driver Kconfig option
    reset: stm32: add driver Kconfig option
    reset: socfpga: add driver Kconfig option
    ...

    Linus Torvalds
     

06 Oct, 2016

1 commit

  • Linux 4.8

    * tag 'v4.8': (1761 commits)
    Linux 4.8
    ARM: 8618/1: decompressor: reset ttbcr fields to use TTBR0 on ARMv7
    MIPS: CM: Fix mips_cm_max_vp_width for non-MT kernels on MT systems
    include/linux/property.h: fix typo/compile error
    ocfs2: fix deadlock on mmapped page in ocfs2_write_begin_nolock()
    mm: workingset: fix crash in shadow node shrinker caused by replace_page_cache_page()
    MAINTAINERS: Switch to kernel.org email address for Javi Merino
    x86/entry/64: Fix context tracking state warning when load_gs_index fails
    x86/boot: Initialize FPU and X86_FEATURE_ALWAYS even if we don't have CPUID
    x86/vdso: Fix building on big endian host
    x86/boot: Fix another __read_cr4() case on 486
    sctp: fix the issue sctp_diag uses lock_sock in rcu_read_lock
    sctp: change to check peer prsctp_capable when using prsctp polices
    sctp: remove prsctp_param from sctp_chunk
    sctp: move sent_count to the memory hole in sctp_chunk
    tg3: Avoid NULL pointer dereference in tg3_io_error_detected()
    x86/init: Fix cr4_init_shadow() on CR4-less machines
    MIPS: Fix detection of unsupported highmem with cache aliases
    MIPS: Malta: Fix IOCU disable switch read for MIPS64
    MIPS: Fix BUILD_ROLLBACK_PROLOGUE for microMIPS
    ...

    Mauro Carvalho Chehab
     

04 Oct, 2016

1 commit

  • Pull usb/phy/extcon updates from Greg KH:
    "Here is the big USB, and PHY, and extcon, patchsets for 4.9-rc1.

    Full details are in the shortlog, but generally a lot of new hardware
    support, usb gadget updates, and Wolfram's great cleanup of USB error
    message handling, making the kernel image a tad bit smaller.

    All of this has been in linux-next with no reported issues"

    * tag 'usb-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (343 commits)
    Revert "usbtmc: convert to devm_kzalloc"
    USB: serial: cp210x: Add ID for a Juniper console
    usb: Kconfig: using select for USB_COMMON dependency
    bluetooth: bcm203x: don't print error when allocating urb fails
    mmc: host: vub300: don't print error when allocating urb fails
    usb: hub: change CLEAR_FEATURE to SET_FEATURE
    usb: core: Introduce a USB port LED trigger
    USB: bcma: drop Northstar PHY 2.0 initialization code
    usb: core: hcd: add missing header dependencies
    usb: musb: da8xx: fix error handling message in probe
    usb: musb: Fix session based PM for first invalid VBUS
    usb: musb: Fix PM runtime for disconnect after unconfigure
    musb: Export musb_root_disconnect for use in modules
    usb: misc: legousbtower: Fix NULL pointer deference
    cdc-acm: hardening against malicious devices
    Revert "usb: gadget: NCM: Protect dev->port_usb using dev->lock"
    include: extcon: Fix compilation error caused because of incomplete merge
    MAINTAINERS: add tree entry for USB Serial
    phy-twl4030-usb: initialize charging-related stuff via pm_runtime
    phy-twl4030-usb: better handle musb_mailbox() failure
    ...

    Linus Torvalds
     

23 Sep, 2016

2 commits


22 Sep, 2016

25 commits

  • This avoids some low-level operations.
    It has the benefit that now register values van be read from /sys/kernel/debug/regmap
    The maximum register value is just a guess - all higher addresses read as zero.

    Signed-off-by: Matthias Schwarzott
    Signed-off-by: Mauro Carvalho Chehab

    Matthias Schwarzott
     
  • Now that there is a i2c_client, use the more specific dev for logging.

    Signed-off-by: Matthias Schwarzott
    Signed-off-by: Mauro Carvalho Chehab

    Matthias Schwarzott
     
  • Now that all users of legacy attach are converted it can be removed.

    Signed-off-by: Matthias Schwarzott
    Signed-off-by: Mauro Carvalho Chehab

    Matthias Schwarzott
     
  • Use new style attach.

    Signed-off-by: Matthias Schwarzott
    Signed-off-by: Mauro Carvalho Chehab

    Matthias Schwarzott
     
  • cx231xx does not yet support attaching new-style i2c_client DVB demod
    drivers. Add necessary code base on tuner support for i2c_client.

    Signed-off-by: Matthias Schwarzott
    Signed-off-by: Mauro Carvalho Chehab

    Matthias Schwarzott
     
  • Use new style attach.

    Signed-off-by: Matthias Schwarzott
    Signed-off-by: Mauro Carvalho Chehab

    Matthias Schwarzott
     
  • Afterwards it is possible to convert attaching in card drivers.

    Signed-off-by: Matthias Schwarzott
    Signed-off-by: Mauro Carvalho Chehab

    Matthias Schwarzott
     
  • When si2165_init fails, the clk values in state are still at zero.
    But the dvb-core ignores the return value of init will call tune
    afterwards.
    This will trigger a division by zero when tuning.
    At least check for the variables to be non-zero before dividing.

    This happened for a system with WinTV HVR-4400 PCIe-card after suspend-to-disk.
    Do suspend-to-disk without accessing the DVB device before.
    After wakeup try to tune.
    si2165_init fails at checking the chip_mode and aborts.
    Then si2165_set_if_freq_shift will fail with div-by-zero.

    Signed-off-by: Matthias Schwarzott
    Signed-off-by: Mauro Carvalho Chehab

    Matthias Schwarzott
     
  • Such fallback string is present in the 'soc_camera' version of the R-Car VIN
    driver, so need to add it here as well...

    Signed-off-by: Sergei Shtylyov
    Acked-by: Niklas Söderlund
    Signed-off-by: Mauro Carvalho Chehab

    Sergei Shtylyov
     
  • inside lgdt3306a_search we reading demod status 20 times with 50 msec sleep after each read.
    This gives us more than 1 sec of delay. Removing this delay should not affect demod functionality.

    Signed-off-by: Abylay Ospan
    Acked-by: Michael Ira Krufky
    Signed-off-by: Mauro Carvalho Chehab

    Abylay Ospan
     
  • The workqueue "_irq_audio_queues" runs the audio upstream handler.
    It has a single work item(&dev->_audio_work_entry) and hence doesn't
    require ordering. Also, it is not being used on a memory reclaim path.
    Hence, the singlethreaded workqueue has been replaced with the use of
    system_wq.

    System workqueues have been able to handle high level of concurrency
    for a long time now and hence it's not required to have a singlethreaded
    workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue
    created with create_singlethread_workqueue(), system_wq allows multiple
    work items to overlap executions even on the same CPU; however, a
    per-cpu workqueue doesn't have any CPU locality or global ordering
    guarantee unless the target CPU is explicitly specified and thus the
    increase of local concurrency shouldn't make any difference.

    The work item has been flushed in cx25821_stop_upstream_audio() to ensure
    that nothing is pending when the driver is disconnected.

    Signed-off-by: Bhaktipriya Shridhar
    Signed-off-by: Mauro Carvalho Chehab

    Bhaktipriya Shridhar
     
  • Workqueues shouldn't be freed. destroy_workqueue should be used instead.
    destroy_workqueue safely destroys a workqueue and ensures that all pending
    work items are done before destroying the workqueue.

    Signed-off-by: Bhaktipriya Shridhar
    Acked-by: Tejun Heo
    Signed-off-by: Mauro Carvalho Chehab

    Bhaktipriya Shridhar
     
  • if specified DVB-C bandwidth not supported then force 8MHz.
    Should work for most cases.

    Signed-off-by: Abylay Ospan
    Signed-off-by: Mauro Carvalho Chehab

    Abylay Ospan
     
  • Add these options as module parameters for now; should other drivers
    need similar options we could add it to the LIRC api.

    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab

    Sean Young
     
  • This is a duplicate of the timeout in rc_dev.

    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab

    Sean Young
     
  • Added function to read BER for ISDB-T
    Also SNR values fixed for ISDB-T

    Signed-off-by: Abylay Ospan
    Signed-off-by: Mauro Carvalho Chehab

    Abylay Ospan
     
  • Tha ARM randconfig builds came up with another rare build failure
    for the dib3000mc driver, when dvb-usb-dibusb-mb is built-in and
    dib3000mc is a loadable module:

    ERROR: "dibusb_dib3000mc_frontend_attach" [drivers/media/usb/dvb-usb/dvb-usb-nova-t-usb2.ko] undefined!
    ERROR: "dibusb_dib3000mc_tuner_attach" [drivers/media/usb/dvb-usb/dvb-usb-nova-t-usb2.ko] undefined!

    Apparently this used to be a valid configuration (build-time, not
    run-time), but broke as part of a cleanup.

    I tried reverting the cleanup, but saw that the code was still wrong
    then. This version adds a dependency for dib3000mb, to ensure that
    dib3000mb does not force the dibusb_dib3000mc_frontend_attach function
    to be built-in when dib3000mc is a loadable module.

    I have also checked the two other files that were changed in the original
    cleanup, and found them to be correct in either version, so I do not
    touch that part.

    As this is a rather obscure bug, there is no need for backports.

    Fixes: 028c70ff42783 ("[media] dvb-usb/dvb-usb-v2: use IS_ENABLED")

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Mauro Carvalho Chehab

    Arnd Bergmann
     
  • Tha ARM randconfig builds came up with another rare build failure
    for the dib3000mc driver, when dvb-usb-dibusb-mb is built-in and
    dib3000mc is a loadable module:

    ERROR: "dibusb_dib3000mc_frontend_attach" [drivers/media/usb/dvb-usb/dvb-usb-nova-t-usb2.ko] undefined!
    ERROR: "dibusb_dib3000mc_tuner_attach" [drivers/media/usb/dvb-usb/dvb-usb-nova-t-usb2.ko] undefined!

    Apparently this used to be a valid configuration (build-time, not
    run-time), but broke as part of a cleanup.

    I tried reverting the cleanup, but saw that the code was still wrong
    then. This tries to fix the code properly, by moving the problematic
    functions into a new file that now is built as a loadable module or
    built-in, whichever is correct for a particular configuration. It fixes
    the regression as well as the runtime problem that already existed.

    The new module dependency chain is now:

    dvb-usb-{dibusb_mc,a800,dib0700,umt-010,gp8psk} dvb-usb-dibusb-mb
    | | | |
    dvb-usb-dibusb-mc-common | ___________| |
    | | | | |
    dib3000mc (frontend) | | | dib3000mb (frontend)
    | | |
    | | |
    dvb-usb-dibusb-common

    I have also checked the two other files that were changed in the original
    cleanup, and found them to be correct in either version, so I do not
    touch that part.

    As this is a rather obscure bug, there is no need for backports.

    Fixes: 028c70ff42783 ("[media] dvb-usb/dvb-usb-v2: use IS_ENABLED")

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Mauro Carvalho Chehab

    Arnd Bergmann
     
  • ensure multiple separate register reads are from the same snapshot

    Signed-off-by: Abylay Ospan
    Signed-off-by: Mauro Carvalho Chehab

    Abylay Ospan
     
  • Currently we do not know what variant (bit length) of the nec protocol
    is used, other than from guessing from the length of the scancode. Now
    nec will be handled the same way as the sony protocol or the rc6 protocol;
    one variant per bit length.

    In the future we might want to expose the rc protocol type to userspace
    and we don't want to be introducing this world of pain into userspace
    too.

    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab

    Sean Young
     
  • The hardware does not decode the 16, 20 or 24 bit variety.

    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab

    Sean Young
     
  • When reporting decoded protocol use the enum rather than the bitmap.

    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab

    Sean Young
     
  • Simplify the code a little.

    Signed-off-by: Heiner Kallweit
    Signed-off-by: Mauro Carvalho Chehab

    Heiner Kallweit
     
  • ir_raw_event_handle is called anyway after the hw fifo content stored
    in nvt->buf[] has been written to the kfifo. There is not really a
    benefit in the potential additional call to ir_raw_event_handle
    whilst nvt->buf[] is being processed.
    Getting rid of this additional call allows to simplify the code.

    Signed-off-by: Heiner Kallweit
    Signed-off-by: Mauro Carvalho Chehab

    Heiner Kallweit
     
  • The call to nvt_get_rx_ir_data and nvt_process_rx_ir_data from
    the ISR is protected with spinlock nvt->lock. Therefore it's
    guaranteed that nvt->pkts is 0 when entering nvt_get_rx_ir_data
    (as nvt->pkts is set to 0 at the end of nvt_process_rx_ir_data).
    Having said that we can remove b_idx.

    Signed-off-by: Heiner Kallweit
    Signed-off-by: Mauro Carvalho Chehab

    Heiner Kallweit