12 Feb, 2019

2 commits


04 Oct, 2018

1 commit

  • commit ad608fbcf166fec809e402d548761768f602702c upstream.

    The event subscriptions are added to the subscribed event list while
    holding a spinlock, but that lock is subsequently released while still
    accessing the subscription object. This makes it possible to unsubscribe
    the event --- and freeing the subscription object's memory --- while
    the subscription object is simultaneously accessed.

    Prevent this by adding a mutex to serialise the event subscription and
    unsubscription. This also gives a guarantee to the callback ops that the
    add op has returned before the del op is called.

    This change also results in making the elems field less special:
    subscriptions are only added to the event list once they are fully
    initialised.

    Signed-off-by: Sakari Ailus
    Reviewed-by: Hans Verkuil
    Reviewed-by: Laurent Pinchart
    Cc: stable@vger.kernel.org # for 4.14 and up
    Fixes: c3b5b0241f62 ("V4L/DVB: V4L: Events: Add backend")
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Sakari Ailus
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

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
     

27 Aug, 2017

5 commits

  • The v4l2_flash_init() keeps a reference to the ops struct but not to the
    config struct (nor anything it contains). Document this.

    Signed-off-by: Sakari Ailus
    Acked-by: Pavel Machek
    Acked-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • The V4L2 flash interface allows controlling multiple LEDs through a single
    sub-devices if, and only if, these LEDs are of different types. This
    approach scales badly for flash controllers that drive multiple flash LEDs
    or for LED specific associations. Essentially, the original assumption of a
    LED driver chip that drives a single flash LED and an indicator LED is no
    longer valid.

    Address the matter by registering one sub-device per LED.

    Signed-off-by: Sakari Ailus
    Reviewed-by: Jacek Anaszewski
    Acked-by: Pavel Machek
    Reviewed-by: Rui Miguel Silva (for greybus/light)
    Acked-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • This change is intended to give to the v4l2 drivers a choice to
    change the default behavior of the v4l2-core DMA mapping direction
    from DMA_TO/FROM_DEVICE (depending on the buffer type CAPTURE or
    OUTPUT) to DMA_BIDIRECTIONAL during queue_init time.

    Initially the issue with DMA mapping direction has been found in
    Venus encoder driver where the hardware (firmware side) adds few
    lines padding on bottom of the image buffer, and the consequence
    is triggering of IOMMU protection faults.

    This will help supporting venus encoder (and probably other drivers
    in the future) which wants to map output type of buffers as
    read/write.

    Signed-off-by: Stanimir Varbanov
    Acked-by: Marek Szyprowski
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Stanimir Varbanov
     
  • Avoid using a generic name such as MAX_DATA_LANES in a header file widely
    included in drivers. Instead, call it V4L2_FWNODE_CSI2_MAX_DATA_LANES.

    Fixes: 4ee236219f6d ("media: v4l2-fwnode: suppress a warning at OF parsing logic")

    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • The clock lane is the first lane in the lane_polarities array. Reflect this
    consistently by putting the number of data lanes after the number of clock
    lanes.

    Fixes: 4ee236219f6d ("media: v4l2-fwnode: suppress a warning at OF parsing logic")

    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     

26 Aug, 2017

1 commit

  • The current CEC pin value (0 or 1) was part of the cec_pin struct,
    but that assumes that CEC pin monitoring can only be used with
    a driver that uses the low-level CEC pin framework.

    But hardware that has both a high-level API and can monitor the
    CEC pin at low-level at the same time does not need to depend on
    the cec pin framework.

    To support such devices remove the cur_value field from struct cec_pin
    and add a cec_pin_is_high field to cec_adapter. This also makes it
    possible to drop the '#ifdef CONFIG_CEC_PIN' in cec-api.c.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

20 Aug, 2017

10 commits

  • RC_TYPE is confusing and it's just the protocol. So rename it.

    Suggested-by: Hans Verkuil
    Signed-off-by: Sean Young
    Acked-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Sean Young
     
  • The 'Press and Hold' operation was not correctly implemented, in
    particular the requirement that the repeat doesn't start until
    the second identical keypress arrives. The REP_DELAY value also
    had to be adjusted (see the comment in the code) to achieve the
    desired behavior.

    The 'enabled_protocols' field was also never set, fix that too. Since
    CEC is a fixed protocol the driver has to set this field.

    Signed-off-by: Hans Verkuil
    Acked-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Since commit 12749b198fa4 ("[media] rc: saa7134: add trailing space for
    timely decoding"), the workaround of inserting reset events is no
    longer needed.

    Note that the initial reset is not needed either; other rc-core drivers
    that don't use ir_raw_event_store_edge() never call this at all.

    Verified on a HVR-1150 and Raspberry Pi.

    Fixes: 3f5c4c73322e ("[media] rc: fix ghost keypresses with certain hw")

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

    Sean Young
     
  • It adds the remote control driver and corresponding keymap file for
    IRDEC block found on ZTE ZX family SoCs.

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

    Shawn Guo
     
  • The NEC scancode composing and protocol type detection in
    ir_nec_decode() is generic enough to be a shared function. Let's create
    an inline function in rc-core.h, so that other remote control drivers
    can reuse this function to save some code.

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

    Shawn Guo
     
  • When an ir-spi is registered, you get this message.

    rc rc0: Unspecified device as /devices/platform/soc/3f215080.spi/spi_master/spi32766/spi32766.128/rc/rc0

    "Unspecified device" refers to input_name, which makes no sense for IR
    TX only devices. So, rename to device_name.

    Also make driver_name const char* so that no casts are needed anywhere.

    Now ir-spi reports:

    rc rc0: IR SPI as /devices/platform/soc/3f215080.spi/spi_master/spi32766/spi32766.128/rc/rc0

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

    Sean Young
     
  • Now that we have a custom printf format specifier, convert users of
    full_name to use %pOF instead. This is preparation to remove storing
    of the full path string for each node.

    Signed-off-by: Rob Herring
    Acked-by: Niklas Söderlund
    Acked-by: Laurent Pinchart
    Reviewed-by: Matthias Brugger
    Acked-by: Nicolas Ferre
    Acked-by: Lad, Prabhakar
    Cc: Kyungmin Park
    Cc: Andrzej Hajda
    Cc: Mauro Carvalho Chehab
    Cc: Songjun Wu
    Cc: Kukjin Kim
    Cc: Krzysztof Kozlowski
    Cc: Javier Martinez Canillas
    Cc: Minghsiu Tsai
    Cc: Houlong Wei
    Cc: Andrew-CT Chen
    Cc: Guennadi Liakhovetski
    Cc: Hyun Kwon
    Cc: Michal Simek
    Cc: "Sören Brinkmann"
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-samsung-soc@vger.kernel.org
    Cc: linux-mediatek@lists.infradead.org
    Cc: linux-renesas-soc@vger.kernel.org
    Reviewed-by: Sylwester Nawrocki
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Rob Herring
     
  • The free_irq() function could be called from interrupt context,
    which is invalid. Move this to the thread.

    In the interrupt handler we just request that the thread disables
    the irq. This is done through an atomic so we don't need to add
    any spinlocks.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • The CEC_EVENT_PIN_LOW/HIGH defines and the cec_queue_pin_event() function
    did not specify that these were about CEC pin events.

    Since in the future there will also be HPD pin events it is wise to rename
    the event defines and function to CEC_EVENT_PIN_CEC_LOW/HIGH and
    cec_queue_pin_cec_event() now before these become part of the ABI.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • The arguments for this function are pointers. Make it clear at
    its documentation.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

15 Aug, 2017

1 commit


09 Aug, 2017

2 commits

  • pci_device_id are not supposed to change at runtime. All functions
    working with pci_device_id provided by work with
    const pci_device_id. So mark the non-const structs as const.
    So making 'pci_tbl' as const member of 'struct saa7146_extension'.

    Signed-off-by: Arvind Yadav
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Arvind Yadav
     
  • The CEC_CAP_LOG_ADDRS, CEC_CAP_TRANSMIT, CEC_CAP_PASSTHROUGH and
    CEC_CAP_RC capabilities are normally always present.

    Add a CEC_CAP_DEFAULTS define that ORs these four caps to simplify
    drivers.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

08 Aug, 2017

3 commits

  • Since the driver_version field in struct media_device is no longer
    used, just remove it.

    Signed-off-by: Hans Verkuil
    Reviewed-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Don't use driver_version from struct media_device, just return
    LINUX_VERSION_CODE as the other media subsystems do.

    The driver_version field in struct media_device will be removed
    in the following patches.

    Signed-off-by: Hans Verkuil
    Reviewed-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Linux 4.13-rc4

    * tag 'v4.13-rc4': (863 commits)
    Linux 4.13-rc4
    Fix compat_sys_sigpending breakage
    ext4: fix copy paste error in ext4_swap_extents()
    ext4: fix overflow caused by missing cast in ext4_resize_fs()
    ext4, project: expand inode extra size if possible
    ext4: cleanup ext4_expand_extra_isize_ea()
    ext4: restructure ext4_expand_extra_isize
    ext4: fix forgetten xattr lock protection in ext4_expand_extra_isize
    ext4: make xattr inode reads faster
    ext4: inplace xattr block update fails to deduplicate blocks
    ext4: remove unused mode parameter
    ext4: fix warning about stack corruption
    ext4: fix dir_nlink behaviour
    ext4: silence array overflow warning
    ext4: fix SEEK_HOLE/SEEK_DATA for blocksize < pagesize
    platform/x86: intel-vbtn: match power button on press rather than release
    ext4: release discard bio after sending discard commands
    sparc64: Fix exception handling in UltraSPARC-III memcpy.
    arm64: avoid overflow in VA_START and PAGE_OFFSET
    arm64: Fix potential race with hardware DBM in ptep_set_access_flags()
    ...

    Mauro Carvalho Chehab
     

03 Aug, 2017

1 commit

  • The driver recently switched from handling page flip completion in the
    DU vertical blanking handler to the VSP frame end handler to fix a race
    condition. This unfortunately resulted in incorrect timestamps in the
    vertical blanking events sent to userspace as vertical blanking is now
    handled after sending the event.

    To fix this we must reverse the order of the two operations. The easiest
    way is to handle vertical blanking in the VSP frame end handler before
    sending the event. The VSP frame end interrupt occurs approximately 50µs
    earlier than the DU frame end interrupt, but this should not cause any
    undue harm.

    As we need to handle vertical blanking even when page flip completion is
    delayed, the VSP driver now needs to call the frame end completion
    callback unconditionally, with a new argument to report whether page
    flip has completed.

    With this new scheme the DU vertical blanking interrupt isn't needed
    anymore, so we can stop enabling it.

    Fixes: d503a43ac06a ("drm: rcar-du: Register a completion callback with VSP1")
    Signed-off-by: Kieran Bingham
    Signed-off-by: Laurent Pinchart
    Acked-by: Mauro Carvalho Chehab

    Kieran Bingham
     

30 Jul, 2017

1 commit

  • In the H3 ES2.0 SoC the VSP2-DL instance has two connections to DU
    channels that need to be configured independently. Extend the VSP-DU API
    with a pipeline index to identify which pipeline the caller wants to
    operate on.

    Signed-off-by: Laurent Pinchart
    Reviewed-by: Kieran Bingham
    Acked-by: Mauro Carvalho Chehab

    Laurent Pinchart
     

27 Jul, 2017

1 commit

  • v4l2_subdev_call is a macro returning whatever the callback return
    type is, usually 'int'. With gcc-7 and ccache, this can lead to
    many wanings like:

    media/platform/pxa_camera.c: In function 'pxa_mbus_build_fmts_xlate':
    media/platform/pxa_camera.c:766:27: error: ?: using integer constants in boolean context [-Werror=int-in-bool-context]
    while (!v4l2_subdev_call(subdev, pad, enum_mbus_code, NULL, &code)) {
    media/atomisp/pci/atomisp2/atomisp_cmd.c: In function 'atomisp_s_ae_window':
    media/atomisp/pci/atomisp2/atomisp_cmd.c:6414:52: error: ?: using integer constants in boolean context [-Werror=int-in-bool-context]
    if (v4l2_subdev_call(isp->inputs[asd->input_curr].camera,

    The problem here is that after preprocessing, we the compiler
    sees a variation of

    if (a ? 0 : 2)

    that it thinks is suspicious.

    This replaces the ?: operator with an different expression that
    does the same thing in a more easily readable way that cannot
    tigger the warning

    Link: https://lkml.org/lkml/2017/7/14/156

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

    Arnd Bergmann
     

26 Jul, 2017

3 commits

  • The V4L2 flash class initialisation expects struct led_classdev_flash that
    describes an indicator but only uses struct led_classdev which is a field
    iled_cdev in the struct. Use struct iled_cdev only.

    Signed-off-by: Sakari Ailus
    Reviewed-by: Jacek Anaszewski
    Reviewed-by: Sebastian Reichel
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • drop VPFE_CMD_S_CCDC_RAW_PARAMS ioctl from dm355/dm644x following reasons:

    - This ioctl was never in public api and was only defined in kernel header.
    - The function set_params constantly mixes up pointers and phys_addr_t
    numbers.
    - This is part of a 'VPFE_CMD_S_CCDC_RAW_PARAMS' ioctl command that is
    described as an 'experimental ioctl that will change in future kernels'.
    - The code to allocate the table never gets called after we copy_from_user
    the user input over the kernel settings, and then compare them
    for inequality.
    - We then go on to use an address provided by user space as both the
    __user pointer for input and pass it through phys_to_virt to come up
    with a kernel pointer to copy the data to. This looks like a trivially
    exploitable root hole.

    Signed-off-by: Lad, Prabhakar
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Prabhakar Lad
     
  • Allow calling cec_notifier_set_phys_addr and
    cec_notifier_set_phys_addr_from_edid with a NULL notifier, in which
    case these functions do nothing.

    Add a cec_notifier_phys_addr_invalidate helper function (the notifier
    equivalent of cec_phys_addr_invalidate).

    These changes simplify drm CEC driver support.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

21 Jul, 2017

4 commits

  • The kernel-doc tag is wrong there, causing this warning:
    ./include/media/v4l2-fwnode.h:66: warning: bad line: index (1)

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • The local pad parameter in media_entity_remote_pad() is not modified.
    Make that explicit by adding a const modifier.

    Signed-off-by: Todor Tomov
    Acked-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Todor Tomov
     
  • smatch produce this warning:
    drivers/media/v4l2-core/v4l2-fwnode.c:76 v4l2_fwnode_endpoint_parse_csi_bus() error: buffer overflow 'array' 5

    Mauro Carvalho Chehab
     
  • drop VPFE_CMD_S_CCDC_RAW_PARAMS ioctl from dm355/dm644x following reasons:

    - This ioctl was never in public api and was only defined in kernel header.
    - The function set_params constantly mixes up pointers and phys_addr_t
    numbers.
    - This is part of a 'VPFE_CMD_S_CCDC_RAW_PARAMS' ioctl command that is
    described as an 'experimental ioctl that will change in future kernels'.
    - The code to allocate the table never gets called after we copy_from_user
    the user input over the kernel settings, and then compare them
    for inequality.
    - We then go on to use an address provided by user space as both the
    __user pointer for input and pass it through phys_to_virt to come up
    with a kernel pointer to copy the data to. This looks like a trivially
    exploitable root hole.

    Signed-off-by: Lad, Prabhakar
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Prabhakar Lad
     

20 Jul, 2017

2 commits


19 Jul, 2017

1 commit

  • The cec_register_cec_notifier function was in media/cec.h, but it
    has to be in cec-notifier.h.

    While we are at it, also document it and add a stub function for when
    the notifier is disabled or the CEC core code is unreachable.

    Based on an earlier patch from Jose Abreu .

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil