10 Sep, 2020

1 commit

  • When devm_ioremap_resource() fails, isp should be
    freed just like other error paths in isp_probe.

    Fixes: 8644cdf972dd6 ("[media] omap3isp: Replace many MMIO regions by two")
    Signed-off-by: Dinghao Liu
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Dinghao Liu
     

01 Sep, 2020

1 commit

  • Rationale:
    Reduces attack surface on kernel devs opening the links for MITM
    as HTTPS traffic is much harder to manipulate.

    Deterministic algorithm:
    For each file:
    If not .svg:
    For each line:
    If doesn't contain `\bxmlns\b`:
    If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
    If both the HTTP and HTTPS versions
    return 200 OK and serve the same content:
    Replace HTTP with HTTPS.

    Signed-off-by: Alexander A. Klimov
    Reviewed-by: Laurent Pinchart
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Alexander A. Klimov
     

29 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva
    Acked-by: Sakari Ailus
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Gustavo A. R. Silva
     

08 Aug, 2020

1 commit

  • Pull media updates from Mauro Carvalho Chehab:

    - Legacy soc_camera driver was removed from staging

    - New I2C sensor related drivers: dw9768, ch7322, max9271, rdacm20

    - TI vpe driver code was re-organized and had new features added

    - Added Xilinx MIPI CSI-2 Rx Subsystem driver

    - Added support for Infrared Toy and IR Droid devices

    - Lots of random driver fixes, new features and cleanups

    * tag 'media/v5.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (318 commits)
    media: camss: fix memory leaks on error handling paths in probe
    media: davinci: vpif_capture: fix potential double free
    media: radio: remove redundant assignment to variable retval
    media: allegro: fix potential null dereference on header
    media: mtk-mdp: Fix a refcounting bug on error in init
    media: allegro: fix an error pointer vs NULL check
    media: meye: fix missing pm_mchip_mode field
    media: cafe-driver: use generic power management
    media: saa7164: use generic power management
    media: v4l2-dev/ioctl: Fix document for VIDIOC_QUERYCAP
    media: v4l2: Correct kernel-doc inconsistency
    media: v4l2: Correct kernel-doc inconsistency
    media: dvbdev.h: keep * together with the type
    media: v4l2-subdev.h: keep * together with the type
    media: videobuf2: Print videobuf2 buffer state by name
    media: colorspaces-details.rst: fix V4L2_COLORSPACE_JPEG description
    media: tw68: use generic power management
    media: meye: use generic power management
    media: cx88: use generic power management
    media: cx25821: use generic power management
    ...

    Linus Torvalds
     

26 Jun, 2020

1 commit

  • After mm.h was removed from the asm-generic version of cacheflush.h,
    s390 allyesconfig shows several warnings of the following nature:

    In file included from arch/s390/include/generated/asm/cacheflush.h:1,
    from drivers/media/platform/omap3isp/isp.c:42:
    include/asm-generic/cacheflush.h:16:42: warning: 'struct mm_struct' declared inside parameter list will not be visible outside of this definition or declaration

    As Geert and Laurent point out, this driver does not need this header in
    the two files that include it. Remove it so there are no warnings.

    Link: http://lkml.kernel.org/r/20200622234740.72825-2-natechancellor@gmail.com
    Fixes: e0cf615d725c ("asm-generic: don't include in cacheflush.h")
    Signed-off-by: Nathan Chancellor
    Suggested-by: Geert Uytterhoeven
    Suggested-by: Laurent Pinchart
    Reviewed-by: Laurent Pinchart
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Mauro Carvalho Chehab
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nathan Chancellor
     

23 Jun, 2020

1 commit


09 Jun, 2020

1 commit

  • This seems to lead to some crazy include loops when using
    asm-generic/cacheflush.h on more architectures, so leave it to the arch
    header for now.

    [hch@lst.de: fix warning]
    Link: http://lkml.kernel.org/r/20200520173520.GA11199@lst.de

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Cc: Will Deacon
    Cc: Nick Piggin
    Cc: Peter Zijlstra
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Cc: Anton Ivanov
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: "H. Peter Anvin"
    Cc: Dan Williams
    Cc: Vishal Verma
    Cc: Dave Jiang
    Cc: Keith Busch
    Cc: Ira Weiny
    Cc: Arnd Bergmann
    Link: http://lkml.kernel.org/r/20200515143646.3857579-7-hch@lst.de
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

02 Mar, 2020

1 commit

  • Currently, v4l2_pipeline_pm_use() prototype is:

    int v4l2_pipeline_pm_use(struct media_entity *entity, int use)

    Where the 'use' argument shall only be set to '1' for enable/power-on,
    or to '0' for disable/power-off. The integer return is specified
    as only meaningful when 'use' is set to '1'.

    Let's enforce this semantic by splitting the function in two:
    v4l2_pipeline_pm_get and v4l2_pipeline_pm_put. This is done
    for several reasons.

    It makes the API easier to use (or harder to misuse).
    It removes the constraint on the values the 'use' argument
    shall take. Also, it removes the need to constraint
    the return value, by making v4l2_pipeline_pm_put void return.

    And last, it's more consistent with other kernel APIs, such
    as the runtime pm APIs, which makes the code more symmetric.

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

    Ezequiel Garcia
     

28 Feb, 2020

1 commit

  • Commit ... prevented restarting CCDC through its interrupt handler when
    it's about to be disabled. It missed to address the case when CCDC might
    be enabled due to queueing a buffer. Do that now.

    Fixes: dd12ed17ce9e ("omap3isp: Don't restart CCDC if we're about to stop")

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

    Sakari Ailus
     

24 Feb, 2020

1 commit


08 Jan, 2020

1 commit

  • Linux 5.5-rc5

    * tag 'v5.5-rc5': (1006 commits)
    Linux 5.5-rc5
    Documentation: riscv: add patch acceptance guidelines
    riscv: prefix IRQ_ macro names with an RV_ namespace
    clocksource: riscv: add notrace to riscv_sched_clock
    apparmor: fix aa_xattrs_match() may sleep while holding a RCU lock
    hexagon: define ioremap_uc
    ocfs2: fix the crash due to call ocfs2_get_dlm_debug once less
    ocfs2: call journal flush to mark journal as empty after journal recovery when mount
    mm/hugetlb: defer freeing of huge pages if in non-task context
    mm/gup: fix memory leak in __gup_benchmark_ioctl
    mm/oom: fix pgtables units mismatch in Killed process message
    fs/posix_acl.c: fix kernel-doc warnings
    hexagon: work around compiler crash
    hexagon: parenthesize registers in asm predicates
    fs/namespace.c: make to_mnt_ns() static
    fs/nsfs.c: include headers for missing declarations
    fs/direct-io.c: include fs/internal.h for missing prototype
    mm: move_pages: return valid node id in status if the page is already on the target node
    memcg: account security cred as well to kmemcg
    kcov: fix struct layout for kcov_remote_arg
    ...

    Mauro Carvalho Chehab
     

03 Jan, 2020

2 commits

  • The omap3isp driver set the new buffer and enabled the CCDC in a situation
    a new buffer was available but streaming was about to be stopped on the
    CCDC. This lead to frequent system crashes in case there were buffers
    queued when streming was being stopped.

    Fix this by first checking whether there's an intent to stop streaming and
    if there isn't, then set the new buffer and re-enable CCDC.

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

    Sakari Ailus
     
  • The isp was marked to have failed to stop if stopping streaming on an
    external subdev failed. The return value from the external subdev should
    be ignored instead as it is not part of the ISP and thus the ISP does not
    need to be reset for that reason.

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

    Sakari Ailus
     

10 Dec, 2019

1 commit

  • Replace all the occurrences of FIELD_SIZEOF() with sizeof_field() except
    at places where these are defined. Later patches will remove the unused
    definition of FIELD_SIZEOF().

    This patch is generated using following script:

    EXCLUDE_FILES="include/linux/stddef.h|include/linux/kernel.h"

    git grep -l -e "\bFIELD_SIZEOF\b" | while read file;
    do

    if [[ "$file" =~ $EXCLUDE_FILES ]]; then
    continue
    fi
    sed -i -e 's/\bFIELD_SIZEOF\b/sizeof_field/g' $file;
    done

    Signed-off-by: Pankaj Bharadiya
    Link: https://lore.kernel.org/r/20190924105839.110713-3-pankaj.laxminarayan.bharadiya@intel.com
    Co-developed-by: Kees Cook
    Signed-off-by: Kees Cook
    Acked-by: David Miller # for net

    Pankaj Bharadiya
     

27 Aug, 2019

1 commit

  • As warned by cppcheck:

    [drivers/media/dvb-frontends/cx24123.c:434]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
    [drivers/media/pci/bt8xx/bttv-input.c:87]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
    [drivers/media/pci/bt8xx/bttv-input.c:98]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
    ...
    [drivers/media/v4l2-core/v4l2-ioctl.c:1391]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour

    There are lots of places where we're doing 1 << 31. That's bad,
    as, depending on the architecture, this has an undefined behavior.

    The BIT() macro is already prepared to handle this, so, let's
    just switch all "1 << number" macros by BIT(number) at the header files
    with has 1 << 31.

    Reviewed-by: Sylwester Nawrocki # exynos4-is and s3c-camif
    Reviewed-by: Laurent Pinchart # omap3isp, vsp1, xilinx, wl128x and ipu3
    Reviewed-by: Benoit Parrot # am437x and ti-vpe
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

15 Aug, 2019

2 commits


08 Aug, 2019

1 commit

  • We don't need dev_err() messages when platform_get_irq() fails now that
    platform_get_irq() prints an error message itself when something goes
    wrong. Let's remove these prints with a simple semantic patch.

    //
    @@
    expression ret;
    struct platform_device *E;
    @@

    ret =
    (
    platform_get_irq(E, ...)
    |
    platform_get_irq_byname(E, ...)
    );

    if ( \( ret < 0 \| ret

    While we're here, remove braces on if statements that only have one
    statement (manually).

    Cc: Greg Kroah-Hartman
    Signed-off-by: Stephen Boyd
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Stephen Boyd
     

25 Jul, 2019

2 commits

  • Rework OF endpoint parsing for the omap3isp driver. This does add some
    lines of code. The benefits are still clear:

    - the great complication related to callbacks in endpoint parsing is gone;
    instead endpoints are obtained port by port and

    - endpoints may now have a default bus configuration which was not
    possible while using callbacks. This driver does not benefit from that
    feature, but as the omap3isp is one of the exemplary drivers, this works
    as an example for driver developers.

    Signed-off-by: Sakari Ailus
    Tested-by: Niklas Söderlund
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • Currently, the v4l2 control code is a bit silent on errors.
    Add debug messages on (hopefully) most of the error paths.

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

    Ezequiel Garcia
     

23 Jul, 2019

1 commit


10 Jul, 2019

1 commit

  • Pull media updates from Mauro Carvalho Chehab:

    - new Atmel microship ISC driver

    - coda has gained support for mpeg2 and mpeg4

    - cxusb gained support for analog TV

    - rockchip staging driver was split into two separate staging drivers

    - added a new staging driver for Allegro DVT video IP core

    - added a new staging driver for Amlogic Meson video decoder

    - lots of improvements and cleanups

    * tag 'media/v5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (398 commits)
    media: allegro: use new v4l2_m2m_ioctl_try_encoder_cmd funcs
    media: doc-rst: Fix typos
    media: radio-raremono: change devm_k*alloc to k*alloc
    media: stv0297: fix frequency range limit
    media: rc: Prefer KEY_NUMERIC_* for number buttons on remotes
    media: dvb_frontend: split dvb_frontend_handle_ioctl function
    media: mceusb: disable "nonsensical irdata" messages
    media: rc: remove redundant dev_err message
    media: cec-notifier: add new notifier functions
    media: cec: add struct cec_connector_info support
    media: cec-notifier: rename variables, check kstrdup and n->conn_name
    media: MAINTAINERS: Add maintainers for Media Controller
    media: staging: media: tegra-vde: Defer dmabuf's unmapping
    media: staging: media: tegra-vde: Add IOMMU support
    media: hdpvr: fix locking and a missing msleep
    media: v4l2: Test type instead of cfg->type in v4l2_ctrl_new_custom()
    media: atmel: atmel-isc: fix i386 build error
    media: v4l2-ctrl: Move compound control initialization
    media: hantro: Use vb2_get_buffer
    media: pci: cx88: Change the type of 'missed' to u64
    ...

    Linus Torvalds
     

19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

12 Jun, 2019

1 commit

  • There are some conflicts due to SPDX changes. We also have more
    patches being merged via media tree touching them.

    So, let's merge back from upstream and address those.

    Linux 5.2-rc4

    * tag 'v5.2-rc4': (767 commits)
    Linux 5.2-rc4
    MAINTAINERS: Karthikeyan Ramasubramanian is MIA
    i2c: xiic: Add max_read_len quirk
    lockref: Limit number of cmpxchg loop retries
    uaccess: add noop untagged_addr definition
    x86/insn-eval: Fix use-after-free access to LDT entry
    kbuild: use more portable 'command -v' for cc-cross-prefix
    s390/unwind: correct stack switching during unwind
    block, bfq: add weight symlink to the bfq.weight cgroup parameter
    cgroup: let a symlink too be created with a cftype file
    drm/nouveau/secboot/gp10[2467]: support newer FW to fix SEC2 failures on some boards
    drm/nouveau/secboot: enable loading of versioned LS PMU/SEC2 ACR msgqueue FW
    drm/nouveau/secboot: split out FW version-specific LS function pointers
    drm/nouveau/secboot: pass max supported FW version to LS load funcs
    drm/nouveau/core: support versioned firmware loading
    drm/nouveau/core: pass subdev into nvkm_firmware_get, rather than device
    block: free sched's request pool in blk_cleanup_queue
    pktgen: do not sleep with the thread lock held.
    net: mvpp2: Use strscpy to handle stat strings
    net: rds: fix memory leak in rds_ib_flush_mr_pool
    ...

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 655 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

30 May, 2019

4 commits

  • platform_device_id are not supposed to change at runtime. All functions
    working with platform_device_id provided by
    work with const platform_device_id. So mark the non-const structs as
    const.

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

    Arvind Yadav
     
  • video_unregister_device() can be called on a never or an already
    unregistered device. Drop the redundant check.

    Signed-off-by: Sakari Ailus
    Reviewed-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • devm functions are fine for managing resources that are directly related
    to the device at hand and that have no other dependencies. However, a
    process holding a file handle to a device created by a driver for a device
    may result in the file handle left behind after the device is long gone.
    This will result in accessing released (and potentially reallocated)
    memory.

    Instead, manage the memory resources in the driver. Releasing the
    resources can be later on bound to e.g. by releasing a reference.

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

    Sakari Ailus
     
  • This patch replaces bit shifting on 1 with the BIT(x) macro.
    This was done with coccinelle:
    @@
    constant c;
    @@

    -1 << c
    +BIT(c)

    [mchehab+samsung@kernel.org: rebase on the top of upstream]
    Signed-off-by: Arushi Singhal
    Signed-off-by: Mauro Carvalho Chehab

    Arushi Singhal
     

01 Mar, 2019

1 commit

  • Use codespell to fix lots of typos over frontends.

    Manually verified to avoid false-positives.

    Reviewed-by: Niklas Söderlund
    Acked-by: Andrzej Pietrasiewicz
    Reviewed-by: Benoit Parrot
    Reviewed-by: Kieran Bingham
    Reviewed-by: Lad, Prabhakar
    Acked-by: Philipp Zabel
    Reviewed-by: Houlong Wei
    Reviewed-by: Yong Deng
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

06 Nov, 2018

1 commit


01 Nov, 2018

1 commit

  • Pull new experimental media request API from Mauro Carvalho Chehab:
    "A new media request API

    This API is needed to support device drivers that can dynamically
    change their parameters for each new frame. The latest versions of
    Google camera and codec HAL depends on such feature.

    At this stage, it supports only stateless codecs.

    It has been discussed for a long time (at least over the last 3-4
    years), and we finally reached to something that seem to work.

    This series contain both the API and core changes required to support
    it and a new m2m decoder driver (cedrus).

    As the current API is still experimental, the only real driver using
    it (cedrus) was added at staging[1]. We intend to keep it there for a
    while, in order to test the API. Only when we're sure that this API
    works for other cases (like encoders), we'll move this driver out of
    staging and set the API into a stone.

    [1] We added support for the vivid virtual driver (used only for
    testing) to it too, as it makes easier to test the API for the ones
    that don't have the cedrus hardware"

    * tag 'media/v4.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (53 commits)
    media: dt-bindings: Document the Rockchip VPU bindings
    media: platform: Add Cedrus VPU decoder driver
    media: dt-bindings: media: Document bindings for the Cedrus VPU driver
    media: v4l: Add definition for the Sunxi tiled NV12 format
    media: v4l: Add definitions for MPEG-2 slice format and metadata
    media: videobuf2-core: Rework and rename helper for request buffer count
    media: v4l2-ctrls.c: initialize an error return code with zero
    media: v4l2-compat-ioctl32.c: add missing documentation for a field
    media: media-request: update documentation
    media: media-request: EPERM -> EACCES/EBUSY
    media: v4l2-ctrls: improve media_request_(un)lock_for_update
    media: v4l2-ctrls: use media_request_(un)lock_for_access
    media: media-request: add media_request_(un)lock_for_access
    media: vb2: set reqbufs/create_bufs capabilities
    media: videodev2.h: add new capabilities for buffer types
    media: buffer.rst: only set V4L2_BUF_FLAG_REQUEST_FD for QBUF
    media: v4l2-ctrls: return -EACCES if request wasn't completed
    media: media-request: return -EINVAL for invalid request_fds
    media: vivid: add request support
    media: vivid: add mc
    ...

    Linus Torvalds
     

05 Oct, 2018

2 commits

  • The CSI-2 bus may use either D-PHY or C-PHY. Make this visible in media
    bus enum.

    Signed-off-by: Sakari Ailus
    Tested-by: Steve Longerbeam
    Tested-by: Jacopo Mondi
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • The fwnode endpoint and reference parsing functions in v4l2-fwnode.c
    are modified to make use of v4l2_async_notifier_add_subdev().
    As a result the notifier->subdevs array is no longer allocated or
    re-allocated, and by extension the max_subdevs value is also no
    longer needed.

    Callers of the fwnode endpoint and reference parsing functions must now
    first initialize the notifier with a call to v4l2_async_notifier_init().
    This includes the function v4l2_async_register_subdev_sensor_common(),
    and the intel-ipu3, omap3isp, and rcar-vin drivers.

    Since the notifier->subdevs array is no longer allocated in the
    fwnode endpoint and reference parsing functions, the callers of
    those functions must never reference that array, since it is now
    NULL. Of the drivers that make use of the fwnode/ref parsing,
    only the intel-ipu3 driver references the ->subdevs[] array,
    (in the notifier completion callback), so that driver has been
    modified to iterate through the notifier->asd_list instead.

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

    Steve Longerbeam
     

12 Sep, 2018

1 commit


31 Aug, 2018

2 commits

  • This implements the V4L2 part of the request support. The main
    change is that vb2_qbuf and vb2_prepare_buf now have a new
    media_device pointer. This required changes to several drivers
    that did not use the vb2_ioctl_qbuf/prepare_buf helper functions.

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

    Hans Verkuil
     
  • The v4l2_g/s_ext_ctrls functions now support control handlers that
    represent requests.

    The v4l2_ctrls_find_req_obj() function is responsible for finding the
    request from the fd.

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

    Hans Verkuil
     

08 Aug, 2018

1 commit

  • As sparse complains:
    drivers/media/platform/omap3isp/isp.c:303:39: warning: Using plain integer as NULL pointer

    when a struct is initialized with { 0 }, actually the first
    element of the struct is initialized with zeros, initializing the
    other elements recursively. That can even generate gcc warnings
    on nested structs.

    So, instead, use the gcc-specific syntax for that (with is used
    broadly inside the Kernel), initializing it with {};

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

28 Jun, 2018

2 commits

  • The struct clk_init_data init variable is declared in the isp_xclk_init()
    function so is an automatic variable allocated in the stack. But it's not
    explicitly zero-initialized, so some init fields are left uninitialized.

    This causes the data structure to have undefined values that may confuse
    the common clock framework when the clock is registered.

    For example, the uninitialized .flags field could have the CLK_IS_CRITICAL
    bit set, causing the framework to wrongly prepare the clk on registration.
    This leads to the isp_xclk_prepare() callback being called, which in turn
    calls to the omap3isp_get() function that increments the isp dev refcount.

    Since this omap3isp_get() call is unexpected, this leads to an unbalanced
    omap3isp_get() call that prevents the requested IRQ to be later enabled,
    due the refcount not being 0 when the correct omap3isp_get() call happens.

    Fixes: 9b28ee3c9122 ("[media] omap3isp: Use the common clock framework")

    Signed-off-by: Javier Martinez Canillas
    Reviewed-by: Sebastian Reichel
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Javier Martinez Canillas
     
  • The final version of the COMPILE_TEST patch for this driver missed
    one warning about suspend/resume functions that can now appear
    on platforms that don't always set CONFIG_PM:

    drivers/media/platform/omap3isp/isp.c:1008:13: error: 'isp_resume_modules' defined but not used [-Werror=unused-function]
    static void isp_resume_modules(struct isp_device *isp)
    ^~~~~~~~~~~~~~~~~~
    drivers/media/platform/omap3isp/isp.c:974:12: error: 'isp_suspend_modules' defined but not used [-Werror=unused-function]
    static int isp_suspend_modules(struct isp_device *isp)

    This marks the respective functions as __maybe_unused as an easy
    workaround.

    Fixes: 243131134be4 ("media: omap3isp: Allow it to build with COMPILE_TEST")

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

    Arnd Bergmann