15 Sep, 2017

1 commit

  • Pull more set_fs removal from Al Viro:
    "Christoph's 'use kernel_read and friends rather than open-coding
    set_fs()' series"

    * 'work.set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    fs: unexport vfs_readv and vfs_writev
    fs: unexport vfs_read and vfs_write
    fs: unexport __vfs_read/__vfs_write
    lustre: switch to kernel_write
    gadget/f_mass_storage: stop messing with the address limit
    mconsole: switch to kernel_read
    btrfs: switch write_buf to kernel_write
    net/9p: switch p9_fd_read to kernel_write
    mm/nommu: switch do_mmap_private to kernel_read
    serial2002: switch serial2002_tty_write to kernel_{read/write}
    fs: make the buf argument to __kernel_write a void pointer
    fs: fix kernel_write prototype
    fs: fix kernel_read prototype
    fs: move kernel_read to fs/read_write.c
    fs: move kernel_write to fs/read_write.c
    autofs4: switch autofs4_write to __kernel_write
    ashmem: switch to ->read_iter

    Linus Torvalds
     

14 Sep, 2017

1 commit

  • gcc-4.4.4 has issues with initialization of anonymous unions:

    drivers/media/cec/cec-adap.c: In function 'cec_queue_msg_fh':
    drivers/media/cec/cec-adap.c:184: error: unknown field 'lost_msgs' specified in initializer

    work around this.

    Fixes: 6b2bbb08747a5 ("media: cec: rework the cec event handling")
    Acked-by: Geert Uytterhoeven
    Cc: Hans Verkuil
    Cc: Maxime Ripard
    Cc: Mauro Carvalho Chehab
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

13 Sep, 2017

1 commit

  • Pull dma-mapping updates from Christoph Hellwig:

    - removal of the old dma_alloc_noncoherent interface

    - remove unused flags to dma_declare_coherent_memory

    - restrict OF DMA configuration to specific physical busses

    - use the iommu mailing list for dma-mapping questions and patches

    * tag 'dma-mapping-4.14' of git://git.infradead.org/users/hch/dma-mapping:
    dma-coherent: fix dma_declare_coherent_memory() logic error
    ARM: imx: mx31moboard: Remove unused 'dma' variable
    dma-coherent: remove an unused variable
    MAINTAINERS: use the iommu list for the dma-mapping subsystem
    dma-coherent: remove the DMA_MEMORY_MAP and DMA_MEMORY_IO flags
    dma-coherent: remove the DMA_MEMORY_INCLUDES_CHILDREN flag
    of: restrict DMA configuration
    dma-mapping: remove dma_alloc_noncoherent and dma_free_noncoherent
    i825xx: switch to switch to dma_alloc_attrs
    au1000_eth: switch to dma_alloc_attrs
    sgiseeq: switch to dma_alloc_attrs
    dma-mapping: reduce dma_mapping_error inline bloat

    Linus Torvalds
     

08 Sep, 2017

1 commit

  • Pull media updates from Mauro Carvalho Chehab:
    "Brazil's Independence Day pull request :-)

    This is one of the biggest media pull requests, with 625 patches
    affecting almost all parts of media (RC, DVB, V4L2, CEC, docs).

    This contains:

    - A lot of new drivers:
    * DVB frontends: mxl5xx, stv0910, stv6111;
    * camera flash: as3645a led driver;
    * HDMI receiver: adv748X;
    * camera sensor: Omnivision 6650 5M driver (ov6650);
    * HDMI CEC: ao-cec meson driver;
    * V4L2: Qualcom camss driver;
    * Remote controller: gpio-ir-tx, pwm-ir-tx and zx-irdec drivers.

    - The DDbridge DVB driver got a massive update, with makes it in sync
    with modern hardware from that vendor;

    - There's an important milestone on this series: the DVB
    documentation was written in 2003, but only started to be updated
    in 2007. It also used to contain several gaps from the time it was
    kept out of tree, mentioning error codes and device nodes that
    never existed upstream. On this series, it received a massive
    update: all non-deprecated digital TV APIs are now in sync with the
    current implementation;

    - Some DVB APIs that aren't used by any upstream driver got removed;

    - Other parts of the media documentation algo got updated, fixing
    some bugs on its PDF output and making it compatible with Sphinx
    version 1.6.

    As the number of hacks required to build PDF output reduced, I hope
    we'll have less troubles as newer versions of our documentation
    toolchain are released (famous last words);

    - As usual, lots of driver cleanups and improvements"

    * tag 'media/v4.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (624 commits)
    media: leds: as3645a: add V4L2_FLASH_LED_CLASS dependency
    media: get rid of removed DMX_GET_CAPS and DMX_SET_SOURCE leftovers
    media: Revert "[media] v4l: async: make v4l2 coexist with devicetree nodes in a dt overlay"
    media: staging: atomisp: sh_css_calloc shall return a pointer to the allocated space
    media: Revert "[media] lirc_dev: remove superfluous get/put_device() calls"
    media: add qcom_camss.rst to v4l-drivers rst file
    media: dvb headers: make checkpatch happier
    media: dvb uapi: move frontend legacy API to another part of the book
    media: pixfmt-srggb12p.rst: better format the table for PDF output
    media: docs-rst: media: Don't use \small for V4L2_PIX_FMT_SRGGB10 documentation
    media: index.rst: don't write "Contents:" on PDF output
    media: pixfmt*.rst: replace a two dots by a comma
    media: vidioc-g-fmt.rst: adjust table format
    media: vivid.rst: add a blank line to correct ReST format
    media: v4l2 uapi book: get rid of driver programming's chapter
    media: format.rst: use the right markup for important notes
    media: docs-rst: cardlists: change their format to flat-tables
    media: em28xx-cardlist.rst: update to reflect last changes
    media: v4l2-event.rst: adjust table to fit on PDF output
    media: docs: don't show ToC for each part on PDF output
    ...

    Linus Torvalds
     

05 Sep, 2017

10 commits

  • Those two ioctls were never used within the Kernel. Still, there
    used to have compat32 code there (and an if #0 block at the core).

    Get rid of them.

    Fixes: 286fe1ca3fa1 ("media: dmx.h: get rid of DMX_GET_CAPS")
    Fixes: 13adefbe9e56 ("media: dmx.h: get rid of DMX_SET_SOURCE")
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • This reverts commit d2180e0cf77dc7a7049671d5d57dfa0a228f83c1.

    The commit was flawed in that if the device_node pointers are different,
    then in fact a different device is present and the device node could be
    different in ways other than full_name.

    As Frank Rowand explained:

    "When an overlay (1) is removed, all uses and references to the nodes and
    properties in that overlay are no longer valid. Any driver that uses any
    information from the overlay _must_ stop using any data from the overlay.
    Any driver that is bound to a new node in the overlay _must_ unbind. Any
    driver that became bound to a pre-existing node that was modified by the
    overlay (became bound after the overlay was applied) _must_ adjust itself
    to account for any changes to that node when the overlay is removed. One
    way to do this is to unbind when notified that the overlay is about to
    be removed, then to re-bind after the overlay is completely removed.

    If an overlay (2) is subsequently applied, a node with the same
    full_name as from overlay (1) may exist. There is no guarantee
    that overlay (1) and overlay (2) are the same overlay, even if
    that node has the same full_name in both cases."

    Also, there's not sufficient overlay support in mainline to actually
    remove and re-apply an overlay to hit this condition as overlays can
    only be applied from in kernel APIs.

    Fixes: d2180e0cf77d ("[media] v4l: async: make v4l2 coexist with devicetree nodes in a dt overlay")

    Cc: Javier Martinez Canillas
    Cc: Sylwester Nawrocki
    Cc: Frank Rowand
    Signed-off-by: Rob Herring
    Acked-by: Javi Merino
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Rob Herring
     
  • This reverts commit 5be2b76a9ca4ea5fd3e221114d62eeb0d78267ca.

    Only when the lirc device is freed, should we drop our reference to
    rc_dev, else we the rc_dev is freed to early. If userspace has
    a file descriptor open during unplug, it goes bang.

    ==================================================================
    BUG: KASAN: use-after-free in __lock_acquire+0x7bb/0x1e10
    Read of size 8 at addr ffff8801d7d61ed0 by task ir-rec/2609

    -snip-
    mutex_lock_nested+0x1b/0x20
    ? mutex_lock_nested+0x1b/0x20
    rc_close.part.6+0x20/0x60 [rc_core]
    rc_close+0x13/0x20 [rc_core]
    lirc_dev_fop_close+0x62/0xd0 [lirc_dev]
    __fput+0x236/0x410
    ? fput+0xb0/0xb0
    ? do_raw_spin_trylock+0x110/0x110
    ? set_rq_offline.part.70+0xa0/0xa0
    ____fput+0xe/0x10
    task_work_run+0x116/0x180
    ? task_work_cancel+0x170/0x170
    ? _raw_spin_unlock+0x27/0x40
    ? switch_task_namespaces+0x5f/0x90
    do_exit+0x68b/0xe80

    Cc: stable@vger.kernel.org # For Kernel 4.13
    Fixes: 5be2b76a9ca4 ("[media] lirc_dev: remove superfluous get/put_device() calls")
    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab

    Sean Young
     
  • This ioctl is not implemented at dst_ca driver. There's just
    a boilerplate code there. Remove it, as it is unlikely that
    anyone would implement it those days.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Right now, on several places, the driver is returning a
    "-1" error to userspace, instead of a proper error code.

    Fix it.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • This ioctl seems to be some attempt to support a feature
    at the bt8xx dst_ca driver. Yet, as said there, it
    "needs more work". Right now, the code there is just
    a boilerplate.

    At the end of the day, no driver uses this ioctl, nor it is
    documented anywhere (except for "needs more work").

    So, get rid of it.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • struct dtv_cmds_h is just an ancillary struct used by the
    dvb_frontend.c to internally store frontend commands.

    It doesn't belong to the userspace header, nor it is used anywhere,
    except inside the DVB core. So, remove it from the header.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Using typedefs inside the Kernel is against CodingStyle, and
    there's no good usage here.

    Just like we did at frontend.h, at commit 0df289a209e0
    ("[media] dvb: Get rid of typedev usage for enums"), let's keep
    those typedefs only to provide userspace backward compatibility.

    No functional changes.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Using typedefs inside the Kernel is against CodingStyle, and
    there's no good usage here.

    Just like we did at frontend.h, at commit 0df289a209e0 ("[media] dvb:
    Get rid of typedev usage for enums"), let's keep those typedefs only
    to provide userspace backward compatibility.

    No functional changes.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Use proper ssize_t and size_t types for the return value and count
    argument, move the offset last and make it an in/out argument like
    all other read/write helpers, and make the buf argument a void pointer
    to get rid of lots of casts in the callers.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

01 Sep, 2017

1 commit


31 Aug, 2017

3 commits


28 Aug, 2017

8 commits

  • When devm_clk_get() fails we should return the real error code
    instead of always returning -ENODEV.

    This allows defer probe to happen in the case the clock provider has
    not been enabled by the time max2175 driver gets probed.

    Signed-off-by: Fabio Estevam
    Signed-off-by: Mauro Carvalho Chehab

    Fabio Estevam
     
  • Add two new model numbers to suppress this message in kernel log:
    cx23885: cx23885[0]: warning: unknown hauppauge model #121029

    Add these model numbers:
    * Model 121019 - WinTV-HVR4400
    * Model 121029 - WinTV-HVR5500

    For WinTV-HVR4400 the documentation and my hardware differ:

    Documentation says it supports DVB-S/S2 and DVB-T,
    but my hardware also supports DVB-C.

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

    Matthias Schwarzott
     
  • The I2C core always reports a MODALIAS of the form i2c: even if the
    device was registered via OF, and the driver is only exporting the OF ID
    table entries as module aliases.

    So if the driver is built as module, autoload won't work since udev/kmod
    won't be able to match the registered OF device with its driver module.

    Before this patch:

    $ modinfo drivers/media/i2c/adv748x/adv748x.ko | grep alias
    alias: of:N*T*Cadi,adv7482C*
    alias: of:N*T*Cadi,adv7482
    alias: of:N*T*Cadi,adv7481C*
    alias: of:N*T*Cadi,adv7481

    After this patch:

    modinfo drivers/media/i2c/adv748x/adv748x.ko | grep alias
    alias: of:N*T*Cadi,adv7482C*
    alias: of:N*T*Cadi,adv7482
    alias: of:N*T*Cadi,adv7481C*
    alias: of:N*T*Cadi,adv7481
    alias: i2c:adv7482
    alias: i2c:adv7481

    Signed-off-by: Javier Martinez Canillas
    Reviewed-by: Kieran Bingham
    Signed-off-by: Mauro Carvalho Chehab

    Javier Martinez Canillas
     
  • dvb_usb_device_description structures are only used during a copy
    operation. Therefore, declare them as const.

    Signed-off-by: Bhumika Goyal
    Signed-off-by: Mauro Carvalho Chehab

    Bhumika Goyal
     
  • If the PLP given is NO_STREAM_ID_FILTER (~0u) don't try to set that into the PLP register. Set PLP to 0 instead.

    Signed-off-by: Olli Salonen
    Signed-off-by: Mauro Carvalho Chehab

    Olli Salonen
     
  • If the PLP given is NO_STREAM_ID_FILTER (~0u) don't try to set that into the PLP register. Set PLP to 0 instead.

    Signed-off-by: Olli Salonen
    Signed-off-by: Mauro Carvalho Chehab

    Olli Salonen
     
  • GIT_AUTHOR_NAME=Colin King
    GIT_AUTHOR_EMAIL=colin.king@canonical.com

    In a previous commit, we added FE_NONE as an unknown fe_status.
    Initialize variable s to FE_NONE instead of the more opaque value 0.

    Signed-off-by: Colin Ian King
    Reviewed-by: Shuah Khan
    Signed-off-by: Mauro Carvalho Chehab

    Colin Ian King
     
  • The fe_status variable s is not initialized meaning it can have any
    random garbage status. This could be problematic if fe->ops.tune is
    false as s is not updated by the call to fe->ops.tune() and a
    subsequent check on the change status will using a garbage value.
    Fix this by adding FE_NONE to the enum fe_status and initializing
    s to this.

    Detected by CoverityScan, CID#112887 ("Uninitialized scalar variable")

    Signed-off-by: Colin Ian King
    Reviewed-by: Shuah Khan
    Signed-off-by: Mauro Carvalho Chehab

    Colin Ian King
     

27 Aug, 2017

14 commits

  • Replace the specification of a data structure by a pointer dereference
    as the parameter for the operator "sizeof" to make the corresponding size
    determination a bit safer according to the Linux coding style convention.

    This issue was detected by using the Coccinelle software.

    Signed-off-by: Markus Elfring
    Signed-off-by: Mauro Carvalho Chehab

    Markus Elfring
     
  • The script “checkpatch.pl” pointed information out like the following.

    Comparison to NULL could be written !…

    Thus fix the affected source code places.

    Signed-off-by: Markus Elfring
    Signed-off-by: Mauro Carvalho Chehab

    Markus Elfring
     
  • Omit an extra message for a memory allocation failure in this function.

    This issue was detected by using the Coccinelle software.

    Signed-off-by: Markus Elfring
    Signed-off-by: Mauro Carvalho Chehab

    Markus Elfring
     
  • Make these const as they are only used in a copy operation.

    Signed-off-by: Bhumika Goyal
    Signed-off-by: Mauro Carvalho Chehab

    Bhumika Goyal
     
  • This function is broken. It sets the wrong front_end to NULL. But it's
    not used, so let's just delete it.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Mauro Carvalho Chehab

    Dan Carpenter
     
  • The dib9000_remove_slave_frontend() function isn't used.

    I was reviewing it because my static checker claims it writes one
    element beyond the end of the array. That's a false positive. What it
    actually does is, if there are two or more front ends, then it prints a
    debug message to say that it removed the first one, stored in
    state->fe[1], and then it "removes" (scare quotes on purpose) the second
    one, stored in state->fe[2]. Deleting a front end from the middle is
    not really supported and breaks code like dib9000_release() which
    assumes the first NULL front end marks the end of the list.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Mauro Carvalho Chehab

    Dan Carpenter
     
  • Make this const as it is only stored in a const field of a
    video_device structure.

    Signed-off-by: Bhumika Goyal
    Signed-off-by: Mauro Carvalho Chehab

    Bhumika Goyal
     
  • Make this const as it is only stored in a const field of a
    video_device structure.

    Signed-off-by: Bhumika Goyal
    Signed-off-by: Mauro Carvalho Chehab

    Bhumika Goyal
     
  • Make these const as they are only used during a copy operation.

    Signed-off-by: Bhumika Goyal
    Acked-by: Mike Isely
    Signed-off-by: Mauro Carvalho Chehab

    Bhumika Goyal
     
  • Make these const as they are either used during a copy operation or
    passed to a const argument of the function cx88_vdev_init.

    Signed-off-by: Bhumika Goyal
    Signed-off-by: Mauro Carvalho Chehab

    Bhumika Goyal
     
  • Make these const as they are only used during a copy operation.
    Done using Coccinelle:

    @match disable optional_qualifier@
    identifier s;
    @@
    static struct video_device s = {...};

    @ref@
    position p;
    identifier match.s;
    @@
    s@p

    @good1@
    identifier match.s;
    expression list[3] es;
    position ref.p;
    @@
    cx88_vdev_init(es,&s@p,...)

    @good2@
    position ref.p;
    identifier match.s,f,c;
    expression e;
    @@
    (
    e = s@p
    |
    e = s@p.f
    |
    c(...,s@p.f,...)
    |
    c(...,s@p,...)
    )

    @bad depends on !good1 && !good2@
    position ref.p;
    identifier match.s;
    @@
    s@p

    @depends on forall !bad disable optional_qualifier@
    identifier match.s;
    @@
    static
    + const
    struct video_device s;

    Signed-off-by: Bhumika Goyal
    Signed-off-by: Mauro Carvalho Chehab

    Bhumika Goyal
     
  • When RC_CORE is a loadable module, and au0828 is built-in including
    the RC support, we get a link error:

    drivers/media/usb/au0828/au0828-input.o: In function `au0828_get_key_au8522':
    au0828-input.c:(.text+0x474): undefined reference to `ir_raw_event_store'
    drivers/media/usb/au0828/au0828-input.o: In function `au0828_rc_register':
    au0828-input.c:(.text+0x7c8): undefined reference to `rc_allocate_device'
    au0828-input.c:(.text+0x8f8): undefined reference to `rc_register_device'

    This adds an additional dependency, similar to the one for em28xx,
    to ensure the broken configuration is never used.

    Fixes: 2fcfd317f66c ("[media] au0828: add support for IR on HVR-950Q")

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

    Arnd Bergmann
     
  • Refactor code in order to avoid identical code for different branches.

    This issue was detected with the help of Coccinelle.

    Addresses-Coverity-ID: 1226795

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Mauro Carvalho Chehab

    Gustavo A. R. Silva
     
  • platform_get_irq() may fail, so we should better check its return
    value and propagate it in the case of error.

    Signed-off-by: Fabio Estevam
    Signed-off-by: Mauro Carvalho Chehab

    Fabio Estevam