1. 01 Feb, 2021 3 commits
  2. 28 Jan, 2021 2 commits
  3. 27 Jan, 2021 5 commits
  4. 25 Jan, 2021 7 commits
  5. 21 Jan, 2021 6 commits
    • Ricardo Ribalda's avatar
      ASoC: Intel: Skylake: Zero snd_ctl_elem_value · 1d8fe064
      Ricardo Ribalda authored
      Clear struct snd_ctl_elem_value before calling ->put() to avoid any data
      leak.
      Signed-off-by: default avatarRicardo Ribalda <ribalda@chromium.org>
      Reviewed-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Link: https://lore.kernel.org/r/20210121171644.131059-2-ribalda@chromium.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      1d8fe064
    • Ricardo Ribalda's avatar
      ASoC: Intel: Skylake: skl-topology: Fix OOPs ib skl_tplg_complete · c1c3ba1f
      Ricardo Ribalda authored
      If dobj->control is not initialized we end up in an OOPs during
      skl_tplg_complete:
      
      [   26.553358] BUG: kernel NULL pointer dereference, address:
      0000000000000078
      [   26.561151] #PF: supervisor read access in kernel mode
      [   26.566897] #PF: error_code(0x0000) - not-present page
      [   26.572642] PGD 0 P4D 0
      [   26.575479] Oops: 0000 [#1] PREEMPT SMP PTI
      [   26.580158] CPU: 2 PID: 2082 Comm: udevd Tainted: G         C
      5.4.81 #4
      [   26.588232] Hardware name: HP Soraka/Soraka, BIOS
      Google_Soraka.10431.106.0 12/03/2019
      [   26.597082] RIP: 0010:skl_tplg_complete+0x70/0x144 [snd_soc_skl]
      
      Fixes: 2d744ecf ("ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHL")
      Signed-off-by: default avatarRicardo Ribalda <ribalda@chromium.org>
      Reviewed-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
      Tested-by: default avatarLukasz Majczak <lma@semihalf.com>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Link: https://lore.kernel.org/r/20210121171644.131059-1-ribalda@chromium.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      c1c3ba1f
    • Stephen Boyd's avatar
      ASoC: qcom: Fix number of HDMI RDMA channels on sc7180 · 7dfe20ee
      Stephen Boyd authored
      Suspending/resuming with an HDMI dongle attached leads to crashes from
      an audio regmap.
      
       Unable to handle kernel paging request at virtual address ffffffc018068000
       Mem abort info:
         ESR = 0x96000047
         EC = 0x25: DABT (current EL), IL = 32 bits
         SET = 0, FnV = 0
         EA = 0, S1PTW = 0
       Data abort info:
         ISV = 0, ISS = 0x00000047
         CM = 0, WnR = 1
       swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000081b12000
       [ffffffc018068000] pgd=0000000275d14003, pud=0000000275d14003, pmd=000000026365d003, pte=0000000000000000
       Internal error: Oops: 96000047 [#1] PREEMPT SMP
       Call trace:
        regmap_mmio_write32le+0x2c/0x40
        regmap_mmio_write+0x48/0x6c
        _regmap_bus_reg_write+0x34/0x44
        _regmap_write+0x100/0x150
        regcache_default_sync+0xc0/0x138
        regcache_sync+0x188/0x26c
        lpass_platform_pcmops_resume+0x48/0x54 [snd_soc_lpass_platform]
        snd_soc_component_resume+0x28/0x40
        soc_resume_deferred+0x6c/0x178
        process_one_work+0x208/0x3c8
        worker_thread+0x23c/0x3e8
        kthread+0x144/0x178
        ret_from_fork+0x10/0x18
       Code: d503201f d50332bf f94002a8 8b344108 (b9000113)
      
      I can reliably reproduce this problem by running 'tail' on the registers
      file in debugfs for the hdmi regmap.
      
       # tail /sys/kernel/debug/regmap/62d87000.lpass-lpass_hdmi/registers
       [   84.658733] Unable to handle kernel paging request at virtual address ffffffd0128e800c
      
      This crash happens because we're trying to read registers from the
      regmap beyond the length of the mapping created by ioremap().
      
      The number of hdmi_rdma_channels determines the size of the regmap via
      this code in sound/soc/qcom/lpass-cpu.c:
      
        lpass_hdmi_regmap_config.max_register = LPAIF_HDMI_RDMAPER_REG(variant, variant->hdmi_rdma_channels);
      
      According to debugfs the size of the regmap is 0x68010 but according to
      the DTS file posted in [1] the size is only 0x68000 (see the first reg
      property of the lpass_cpu node). Let's change the number of channels to
      be 3 instead of 4 so the math works out to have a max register of
      0x67010, nicely fitting inside of the region size of 0x68000.
      
      Note: I tried to bump up the size of the register region to the next
      page to include the 0x68010 register but then the tail command caused
      SErrors with an async abort, implying that the register region doesn't
      exist or it isn't clocked because the bus is telling us that the
      register read failed. I reduce the number of channels and played audio
      through the HDMI channel and it kept working so I think this is correct.
      
      Fixes: 2ad63dc8 ("ASoC: qcom: sc7180: Add support for audio over DP")
      Link: https://lore.kernel.org/r/1601448168-18396-2-git-send-email-srivasam@codeaurora.org [1]
      Cc: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
      Cc: Srinivasa Rao <srivasam@codeaurora.org>
      Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Cc: Cheng-Yi Chiang <cychiang@chromium.org>
      Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
      Link: https://lore.kernel.org/r/20210115203329.846824-1-swboyd@chromium.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      7dfe20ee
    • Mark Brown's avatar
      Merge series "ASoC: qcom: Fix broken lpass driver" from Srinivas Kandagatla... · 411fc208
      Mark Brown authored
      Merge series "ASoC: qcom: Fix broken lpass driver" from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:
      
      LPASS driver is partially broken on DragonBoard DB410c on 5.10 and
      its totally broken on other Supported Qualcomm SoCs.
      
      This was due to DAI ids being over written by the SoC specific header files
      in the dt-bindings.
      
      Idea of having SoC specific headers is not doable when we are dealing with
      a common driver. So this patchset attempts to fix this properly by creating
      a common dt-bindings header for lpass which can be updated with new entries
      if required. This patchset also add an simple of_xlate function to resolve
      the dai names and different SoCs might not have 1:1 mapping for the
      dai_driver array with dai ids.
      
      Changes since v1:
      	- removed array indexes as suggested by Stephan G.
      	- rebased to sound/for-next branch
      	- collected Srinivasa tested-by tag for sc7180 platform.
      
      Thanks,
      srini
      
      Srinivas Kandagatla (2):
        ASoC: dt-bindings: lpass: Fix and common up lpass dai ids
        ASoC: qcom: Fix broken support to MI2S TERTIARY and QUATERNARY
      
       include/dt-bindings/sound/apq8016-lpass.h |  7 +++----
       include/dt-bindings/sound/qcom,lpass.h    | 15 +++++++++++++++
       include/dt-bindings/sound/sc7180-lpass.h  |  6 ++----
       sound/soc/qcom/lpass-cpu.c                | 22 ++++++++++++++++++++++
       sound/soc/qcom/lpass-platform.c           | 12 ++++++++++++
       sound/soc/qcom/lpass-sc7180.c             |  9 +++------
       sound/soc/qcom/lpass.h                    |  2 +-
       7 files changed, 58 insertions(+), 15 deletions(-)
       create mode 100644 include/dt-bindings/sound/qcom,lpass.h
      
      --
      2.21.0
      411fc208
    • Mark Brown's avatar
      Merge series "ASoC: mediatek: mt8183: ignore TDM DAI link by by default" from... · d146c7b0
      Mark Brown authored
      Merge series "ASoC: mediatek: mt8183: ignore TDM DAI link by by default" from Tzung-Bi Shih <tzungbi@google.com>:
      
      hdmi-codec is an optional property.  The 2 patches fix DAI link binding
      error when the property doesn't exist in DTS.
      
      Tzung-Bi Shih (2):
        ASoC: mediatek: mt8183-mt6358: ignore TDM DAI link by default
        ASoC: mediatek: mt8183-da7219: ignore TDM DAI link by default
      
       sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c         | 5 ++++-
       sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c | 5 ++++-
       2 files changed, 8 insertions(+), 2 deletions(-)
      
      --
      2.30.0.284.gd98b1dd5eaa7-goog
      d146c7b0
    • Mark Brown's avatar
      Merge series "Add KUNIT tests for ASoC topology" from Amadeusz... · 29be3f02
      Mark Brown authored
      Merge series "Add KUNIT tests for ASoC topology" from Amadeusz Sławiński<amadeuszx.slawinski@linux.intel.com>:
      
      This series adds unit tests for ASoC topology.
      
      First fix problems found when developing and running test cases and
      then add tests implementation.
      
      Tests themselves are quite simple and just call
      snd_soc_tplg_component_load() with various parameters and check the
      result. Tests themselves are described in more detail in commits
      adding them.
      
      Goal is to expand the amount of test cases in following patches.
      
      Prerequisity for this patchset are 2 patches which have already been
      sent:
      https://lore.kernel.org/alsa-devel/20210114163602.911205-1-amadeuszx.slawinski@linux.intel.com/T/#t
      
      Description on how typical test case itself works:
      
      In order to load topology we need to have 3 things:
      card, codec component & platform component.
      
      In typical test case we register card and platform component and bind
      to dummy codec. There are of course execeptions, when we want to
      test behaviour of topology API when component or card is missing.
      Note that this is bit different from typical scenario (in SOF and skylake
      drivers) where card is registered by machine driver and component by
      platform driver, as we register both when setting up test.
      
      If you check the test case most of them have similar architecture of:
      1.
      	/* run test */
      	ret = snd_soc_register_card(&kunit_comp->card);
      	if (ret != 0 && ret != -EPROBE_DEFER)
      		KUNIT_FAIL(test, "Failed to register card");
      
      2.
      	ret = snd_soc_component_initialize(&kunit_comp->comp, &test_component, test_dev);
      	KUNIT_EXPECT_EQ(test, 0, ret);
      
      3.
      	ret = snd_soc_add_component(&kunit_comp->comp, NULL, 0);
      	KUNIT_EXPECT_EQ(test, 0, ret);
      
      Ad. 1.
      First we register card, which in most tests returns -EPROBE_DEFER
      (from snd_soc_bind_card()), as platform component is not yet created.
      I test for both 0 and -EPROBE_DEFER, as it makes it easier to reshuffle
      this code around if needed and there is one test case which does it in
      different order.
      
      Ad. 2.
      Then we initialize platform component with structure pointing at proper
      probe function, which calls snd_soc_tplg_component_load() with test
      parameters and checks expected result.
      
      Ad. 3.
      And then in follow up we call snd_soc_add_component() which creates
      platform component for us and calls snd_soc_try_rebind_card() which
      if everything is bound properly calls previously set probe function.
      
      Amadeusz Sławiński (5):
        ASoC: topology: Properly unregister DAI on removal
        Revert "ASoC: soc-devres: add devm_snd_soc_register_dai()"
        ASoC: topology: KUnit: Add KUnit tests passing various arguments to
          snd_soc_tplg_component_load
        ASoC: topology: KUnit: Add KUnit tests passing empty topology with
          variants to snd_soc_tplg_component_load
        ASoC: topology: KUnit: Add KUnit tests passing topology with PCM to
          snd_soc_tplg_component_load
      
       include/sound/soc.h           |   4 -
       sound/soc/Kconfig             |  17 +
       sound/soc/Makefile            |   5 +
       sound/soc/soc-devres.c        |  37 --
       sound/soc/soc-topology-test.c | 843 ++++++++++++++++++++++++++++++++++
       sound/soc/soc-topology.c      |   9 +-
       6 files changed, 870 insertions(+), 45 deletions(-)
       create mode 100644 sound/soc/soc-topology-test.c
      
      --
      2.25.1
      29be3f02
  6. 20 Jan, 2021 8 commits
  7. 18 Jan, 2021 2 commits
  8. 15 Jan, 2021 2 commits
  9. 13 Jan, 2021 5 commits
    • Mark Brown's avatar
      Merge v5.11-rc3 · cea06d9b
      Mark Brown authored
      cea06d9b
    • Kai Vehmanen's avatar
      ASoC: SOF: Intel: fix page fault at probe if i915 init fails · 9c25af25
      Kai Vehmanen authored
      The earlier commit to fix runtime PM in case i915 init fails,
      introduces a possibility to hit a page fault.
      
      snd_hdac_ext_bus_device_exit() is designed to be called from
      dev.release(). Calling it outside device reference counting, is
      not safe and may lead to calling the device_exit() function
      twice. Additionally, as part of ext_bus_device_init(), the device
      is also registered with snd_hdac_device_register(). Thus before
      calling device_exit(), the device must be removed from device
      hierarchy first.
      
      Fix the issue by rolling back init actions by calling
      hdac_device_unregister() and then releasing device with put_device().
      This matches with existing code in hdac-ext module.
      
      To complete the fix, add handling for the case where
      hda_codec_load_module() returns -ENODEV, and clean up the hdac_ext
      resources also in this case.
      
      In future work, hdac-ext interface should be extended to allow clients
      more flexibility to handle the life-cycle of individual devices, beyond
      just the current snd_hdac_ext_bus_device_remove(), which removes all
      devices.
      
      BugLink: https://github.com/thesofproject/linux/issues/2646Reported-by: default avatarJaroslav Kysela <perex@perex.cz>
      Fixes: 6c63c954 ("ASoC: SOF: fix a runtime pm issue in SOF when HDMI codec doesn't work")
      Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Reviewed-by: default avatarRander Wang <rander.wang@intel.com>
      Reviewed-by: default avatarLibin Yang <libin.yang@intel.com>
      Reviewed-by: default avatarBard Liao <bard.liao@intel.com>
      Link: https://lore.kernel.org/r/20210113150715.3992635-1-kai.vehmanen@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      9c25af25
    • Kai-Heng Feng's avatar
      ASoC: SOF: Intel: hda: Avoid checking jack on system suspend · ef4d764c
      Kai-Heng Feng authored
      System takes a very long time to suspend after commit 215a22ed
      ("ALSA: hda: Refactor codec PM to use direct-complete optimization"):
      [   90.065964] PM: suspend entry (s2idle)
      [   90.067337] Filesystems sync: 0.001 seconds
      [   90.185758] Freezing user space processes ... (elapsed 0.002 seconds) done.
      [   90.188713] OOM killer disabled.
      [   90.188714] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
      [   90.190024] printk: Suspending console(s) (use no_console_suspend to debug)
      [   90.904912] intel_pch_thermal 0000:00:12.0: CPU-PCH is cool [49C], continue to suspend
      [  321.262505] snd_hda_codec_realtek ehdaudio0D0: Unable to sync register 0x2b8000. -5
      [  328.426919] snd_hda_codec_realtek ehdaudio0D0: Unable to sync register 0x2b8000. -5
      [  329.490933] ACPI: EC: interrupt blocked
      
      That commit keeps the codec suspended during the system suspend. However,
      mute/micmute LED will clear codec's direct-complete flag by
      dpm_clear_superiors_direct_complete().
      
      This doesn't play well with SOF driver. When its runtime resume is
      called for system suspend, hda_codec_jack_check() schedules
      jackpoll_work which uses snd_hdac_is_power_on() to check whether codec
      is suspended. Because the direct-complete path isn't taken,
      pm_runtime_disable() isn't called so snd_hdac_is_power_on() returns
      false and jackpoll continues to run, and snd_hda_power_up_pm() cannot
      power up an already suspended codec in multiple attempts, causes the
      long delay on system suspend:
      
      if (dev->power.direct_complete) {
      	if (pm_runtime_status_suspended(dev)) {
      		pm_runtime_disable(dev);
      		if (pm_runtime_status_suspended(dev)) {
      			pm_dev_dbg(dev, state, "direct-complete ");
      			goto Complete;
      		}
      
      		pm_runtime_enable(dev);
      	}
      	dev->power.direct_complete = false;
      }
      
      When direct-complete path is taken, snd_hdac_is_power_on() returns true
      and hda_jackpoll_work() is skipped by accident. So this is still not
      correct.
      
      If we were to use snd_hdac_is_power_on() in system PM path,
      pm_runtime_status_suspended() should be used instead of
      pm_runtime_suspended(), otherwise pm_runtime_{enable,disable}() may
      change the outcome of snd_hdac_is_power_on().
      
      Because devices suspend in reverse order (i.e. child first), it doesn't
      make much sense to resume an already suspended codec from audio
      controller. So avoid the issue by making sure jackpoll isn't used in
      system PM process.
      
      Fixes: 215a22ed ("ALSA: hda: Refactor codec PM to use direct-complete optimization")
      Signed-off-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
      Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Link: https://lore.kernel.org/r/20210112181128.1229827-3-kai.heng.feng@canonical.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      ef4d764c
    • Kai-Heng Feng's avatar
      ASoC: SOF: Intel: hda: Modify existing helper to disable WAKEEN · 31ba0c07
      Kai-Heng Feng authored
      Modify hda_codec_jack_wake_enable() to also support disable WAKEEN.
      In addition, this patch also moves the WAKEEN disablement call out of
      hda_codec_jack_check() into hda_codec_jack_wake_enable().
      
      This is a preparation for next patch.
      
      No functional change intended.
      Signed-off-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
      Link: https://lore.kernel.org/r/20210112181128.1229827-2-kai.heng.feng@canonical.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      31ba0c07
    • Kai-Heng Feng's avatar
      ASoC: SOF: Intel: hda: Resume codec to do jack detection · bcd7059a
      Kai-Heng Feng authored
      Instead of queueing jackpoll_work, runtime resume the codec to let it
      use different jack detection methods based on jackpoll_interval.
      
      This partially matches SOF driver's behavior with commit a6e7d0a4
      ("ALSA: hda: fix jack detection with Realtek codecs when in D3"), the
      difference is SOF unconditionally resumes the codec.
      Signed-off-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
      Link: https://lore.kernel.org/r/20210112181128.1229827-1-kai.heng.feng@canonical.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      bcd7059a