1. 09 Apr, 2021 32 commits
  2. 08 Apr, 2021 2 commits
    • Mauro Carvalho Chehab's avatar
      media: venus: don't de-reference NULL pointers at IRQ time · 686ee9b6
      Mauro Carvalho Chehab authored
      Smatch is warning that:
      	drivers/media/platform/qcom/venus/hfi_venus.c:1100 venus_isr() warn: variable dereferenced before check 'hdev' (see line 1097)
      
      The logic basically does:
      	hdev = to_hfi_priv(core);
      
      with is translated to:
      	hdev = core->priv;
      
      If the IRQ code can receive a NULL pointer for hdev, there's
      a bug there, as it will first try to de-reference the pointer,
      and then check if it is null.
      
      After looking at the code, it seems that this indeed can happen:
      Basically, the venus IRQ thread is started with:
      	devm_request_threaded_irq()
      So, it will only be freed after the driver unbinds.
      
      In order to prevent the IRQ code to work with freed data,
      the logic at venus_hfi_destroy() sets core->priv to NULL,
      which would make the IRQ code to ignore any pending IRQs.
      
      There is, however a race condition, as core->priv is set
      to NULL only after being freed. So, we need also to move the
      core->priv = NULL to happen earlier.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      686ee9b6
    • Mauro Carvalho Chehab's avatar
      media: venus: use NULL instead of zero for pointers · b6f13994
      Mauro Carvalho Chehab authored
      As reported by sparse:
      
      	drivers/media/platform/qcom/venus/core.c:227:41: warning: Using plain integer as NULL pointer
      	drivers/media/platform/qcom/venus/core.c:228:34: warning: Using plain integer as NULL pointer
      
      Two vars are using zero instead of NULL for pointers. Not really
      an issue, but using NULL makes it clearer that the init data is
      expecting a pointer.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      b6f13994
  3. 07 Apr, 2021 2 commits
  4. 06 Apr, 2021 4 commits
    • Sylwester Nawrocki's avatar
      media: s5p-mfc: Fix kernel-doc entries in s5p_mfc_common.h · 7acc54ed
      Sylwester Nawrocki authored
      Fixes scripts/kernel-doc warnings:
      
      s5p_mfc_common.h:343: warning: Function parameter or member 'fw_buf' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'mem_size' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'mem_base' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'mem_bitmap' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'mem_virt' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'dma_base' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'watchdog_timer' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'fw_get_done' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:343: warning: Function parameter or member 'risc_on' not described in 's5p_mfc_dev'
      s5p_mfc_common.h:714: warning: Function parameter or member 'src_bufs_cnt' not described in 's5p_mfc_ctx'
      s5p_mfc_common.h:714: warning: Function parameter or member 'dst_bufs_cnt' not described in 's5p_mfc_ctx'
      s5p_mfc_common.h:714: warning: Function parameter or member 'pb_count' not described in 's5p_mfc_ctx'
      s5p_mfc_common.h:714: warning: Function parameter or member 'force_frame_type' not described in 's5p_mfc_ctx'
      s5p_mfc_common.h:714: warning: Function parameter or member 'slice_mode' not described in 's5p_mfc_ctx'
      s5p_mfc_common.h:714: warning: Function parameter or member 'slice_size' not described in 's5p_mfc_ctx'
      s5p_mfc_common.h:714: warning: Function parameter or member 'frame_tag' not described in 's5p_mfc_ctx'
      s5p_mfc_common.h:714: warning: Function parameter or member 'scratch_buf_size' not described in 's5p_mfc_ctx'
      Reported-by: default avatarHans verkuil <hverkuil@xs4all.nl>
      Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      7acc54ed
    • Sylwester Nawrocki's avatar
      media: exynos4-is: Fix kernel-doc entries in fimc-is.h · 08874fdd
      Sylwester Nawrocki authored
      Fixes scripts/kernel-doc warnings:
      
      fimc-is.h:286: warning: Function parameter or member 'fw' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'memory' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'f_w' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'isp' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'sensor' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'setfile' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'ctrl_handler' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'irq' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'sensor_index' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'i2h_cmd' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'h2i_cmd' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'fd_header' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'config' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'config_index' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'is_p_region' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'is_dma_p_region' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'is_shared_region' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'af' not described in 'fimc_is'
      fimc-is.h:286: warning: Function parameter or member 'debugfs_entry' not described in 'fimc_is'
      
      The f_w field is unused so remove it.
      Reported-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      08874fdd
    • Hans Verkuil's avatar
      media: adv7511-v4l2: correctly report EDIDs of 1 block · b24bc3ab
      Hans Verkuil authored
      If the EDID has an odd number of blocks (usually just 1, but the
      same problem occurs with 3 blocks), then VIDIOC_G_EDID reported 2
      (or 4) blocks. Fix this.
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      b24bc3ab
    • Hans Verkuil's avatar
      media: adv7604: support EDIDs up to 4 blocks · c730ff32
      Hans Verkuil authored
      While the adv7604/11/12 hardware supported EDIDs up to 4 blocks, the
      driver didn't. This patch adds support for this. It also improves support
      for EDIDs that do not have a Source Physical Address: in that case the
      spa location is set to the first byte of the second block, and the
      'physical address' is just the two bytes at that location. This is per
      the suggestion in the adv76xx documentation for such EDIDs.
      
      Tested with an adv7604 and adv7612.
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      c730ff32