1. 28 Jun, 2021 2 commits
    • Dafna Hirschfeld's avatar
      media: mtk-vpu: on suspend, read/write regs only if vpu is running · 11420749
      Dafna Hirschfeld authored
      If the vpu is not running, we should not rely on VPU_IDLE_REG
      value. In this case, the suspend cb should only unprepare the
      clock. This fixes a system-wide suspend to ram failure:
      
      [  273.073363] PM: suspend entry (deep)
      [  273.410502] mtk-msdc 11230000.mmc: phase: [map:ffffffff] [maxlen:32] [final:10]
      [  273.455926] Filesystems sync: 0.378 seconds
      [  273.589707] Freezing user space processes ... (elapsed 0.003 seconds) done.
      [  273.600104] OOM killer disabled.
      [  273.603409] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
      [  273.613361] mwifiex_sdio mmc2:0001:1: None of the WOWLAN triggers enabled
      [  274.784952] mtk_vpu 10020000.vpu: vpu idle timeout
      [  274.789764] PM: dpm_run_callback(): platform_pm_suspend+0x0/0x70 returns -5
      [  274.796740] mtk_vpu 10020000.vpu: PM: failed to suspend: error -5
      [  274.802842] PM: Some devices failed to suspend, or early wake event detected
      [  275.426489] OOM killer enabled.
      [  275.429718] Restarting tasks ...
      [  275.435765] done.
      [  275.447510] PM: suspend exit
      
      Fixes: 1f565e26 ("media: mtk-vpu: VPU should be in idle state before system is suspended")
      Signed-off-by: default avatarDafna Hirschfeld <dafna.hirschfeld@collabora.com>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      11420749
    • Philipp Zabel's avatar
      media: video-mux: Skip dangling endpoints · 95778c2d
      Philipp Zabel authored
      i.MX6 device tree include files contain dangling endpoints for the
      board device tree writers' convenience. These are still included in
      many existing device trees.
      Treat dangling endpoints as non-existent to support them.
      Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Fixes: 612b385e ("media: video-mux: Create media links in bound notifier")
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      95778c2d
  2. 24 Jun, 2021 1 commit
    • Shuah Khan's avatar
      media: Fix Media Controller API config checks · 50e7a31d
      Shuah Khan authored
      Smatch static checker warns that "mdev" can be null:
      
      sound/usb/media.c:287 snd_media_device_create()
          warn: 'mdev' can also be NULL
      
      If CONFIG_MEDIA_CONTROLLER is disabled, this file should not be included
      in the build.
      
      The below conditions in the sound/usb/Makefile are in place to ensure that
      media.c isn't included in the build.
      
      sound/usb/Makefile:
      snd-usb-audio-$(CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER) += media.o
      
      select SND_USB_AUDIO_USE_MEDIA_CONTROLLER if MEDIA_CONTROLLER &&
             (MEDIA_SUPPORT=y || MEDIA_SUPPORT=SND_USB_AUDIO)
      
      The following config check in include/media/media-dev-allocator.h is
      in place to enable the API only when CONFIG_MEDIA_CONTROLLER and
      CONFIG_USB are enabled.
      
       #if defined(CONFIG_MEDIA_CONTROLLER) && defined(CONFIG_USB)
      
      This check doesn't work as intended when CONFIG_USB=m. When CONFIG_USB=m,
      CONFIG_USB_MODULE is defined and CONFIG_USB is not. The above config check
      doesn't catch that CONFIG_USB is defined as a module and disables the API.
      This results in sound/usb enabling Media Controller specific ALSA driver
      code, while Media disables the Media Controller API.
      
      Fix the problem requires two changes:
      
      1. Change the check to use IS_ENABLED to detect when CONFIG_USB is enabled
         as a module or static. Since CONFIG_MEDIA_CONTROLLER is a bool, leave
         the check unchanged to be consistent with drivers/media/Makefile.
      
      2. Change the drivers/media/mc/Makefile to include mc-dev-allocator.o
         in mc-objs when CONFIG_USB is enabled.
      
      Link: https://lore.kernel.org/alsa-devel/YLeAvT+R22FQ%2FEyw@mwanda/Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      50e7a31d
  3. 17 Jun, 2021 37 commits