1. 15 Dec, 2021 5 commits
    • Pierre-Louis Bossart's avatar
      ASoC: AMD: fix depend/select mistake on SND_AMD_ACP_CONFIG · fb6c83ca
      Pierre-Louis Bossart authored
      on i386 or x86_64:
      
      when # CONFIG_ACPI is not set,
      so SND_SOC_ACPI is not set:
      
      WARNING: unmet direct dependencies detected for SND_AMD_ACP_CONFIG
        Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] &&
        SND_SOC_ACPI [=n]
        Selected by [y]:
        - SND_SOC_AMD_ACP_COMMON [=y] && SOUND [=y] && !UML && SND [=y] &&
        SND_SOC [=y] && X86 [=y] && PCI [=y]
      
      This problem is due to the unconditional selection of
      SND_AMD_ACP_CONFIG in other options. Using 'depends on' solved an
      initial problem but exposed another, let's use select instead.
      Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Fixes: d9b994cd ('ASoC: AMD: acp-config: fix missing dependency on SND_SOC_ACPI')
      Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
      Reviewed-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
      Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@intel.com>
      Reviewed-by: default avatarAjit Kumar Pandey <AjitKumar.Pandey@amd.com>
      Link: https://lore.kernel.org/r/20211215163511.151286-1-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      fb6c83ca
    • David Heidelberg's avatar
      ASoC: nvidia,tegra-audio: Convert multiple txt bindings to yaml · 88dffe43
      David Heidelberg authored
      Convert Tegra audio complex with the
        * ALC5632
        * MAX98090
        * RT5640
        * RT5677
        * SGTL5000
        * TrimSlice
        * WM8753
        * WM8903
        * WM9712
      codec to the YAML format.
      
      Additional changes:
       - added missing HPOUTL to the WM9712 codec.
       - extended rt5677 codec with multiple pins
      Reviewed-by: default avatarDmitry Osipenko <digetx@gmail.com>
      Signed-off-by: default avatarDavid Heidelberg <david@ixit.cz>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Link: https://lore.kernel.org/r/20211211224946.79875-1-david@ixit.czSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      88dffe43
    • Jiasheng Jiang's avatar
      ASoC: rt5663: Handle device_property_read_u32_array error codes · 2167c0b2
      Jiasheng Jiang authored
      The return value of device_property_read_u32_array() is not always 0.
      To catch the exception in case that devm_kzalloc failed and the
      rt5663->imp_table was NULL, which caused the failure of
      device_property_read_u32_array.
      
      Fixes: 450f0f6a ("ASoC: rt5663: Add the manual offset field to compensate the DC offset")
      Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
      Link: https://lore.kernel.org/r/20211215031550.70702-1-jiasheng@iscas.ac.cnSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      2167c0b2
    • Daniel Baluta's avatar
      ASoC: SOF: OF: Avoid reverse module dependency · 28084f4a
      Daniel Baluta authored
      Similar with commit 8a49cd11 ("ASoC: SOF: ACPI: avoid reverse
      module dependency") we will be having hardware specific drivers that
      link against a common "helper" framework.
      
      sof-of-dev.c becomes a library with the interface defined in the newly
      created file sof-of-dev.h.
      
      This is the final step started with Kconfig simplification in
      commit 7548a391 ("ASoC: SOF: i.MX: simplify Kconfig")
      Signed-off-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
      Reviewed-by: default avatarPaul Olaru <paul.olaru@oss.nxp.com>
      Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
      Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Link: https://lore.kernel.org/r/20211215085703.137414-1-daniel.baluta@oss.nxp.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      28084f4a
    • Mark Brown's avatar
      ASoC : soc-pcm: fix trigger race conditions with shared BE · 9e376b14
      Mark Brown authored
      Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
      
      We've been adding a 'deep buffer' PCM device to several SOF topologies
      in order to reduce power consumption. The typical use-case would be
      music playback over a headset: this additional PCM device provides
      more buffering and longer latencies, leaving the rest of the system
      sleep for longer periods. Notifications and 'regular' low-latency
      audio playback would still use the 'normal' PCM device and be mixed
      with the 'deep buffer' before rendering on the headphone endpoint. The
      tentative direction would be to expose this alternate device to
      PulseAudio/PipeWire/CRAS via the UCM SectionModifier definitions.
      
      That seemed a straightforward topology change until our automated
      validation stress tests started reporting issues on SoundWire
      platforms, when e.g. two START triggers might be send and conversely
      the STOP trigger is never sent. The SoundWire stream state management
      flagged inconsistent states when the two 'normal' and 'deep buffer'
      devices are used concurrently with rapid play/stop/pause monkey
      testing.
      
      Looking at the soc-pcm.c code, it seems that the BE state
      management needs a lot of love.
      
      a) there is no consistent protection for the BE state. In some parts
      of the code, the state updates are protected by a spinlock but in the
      trigger they are not. When we open/play/close the two PCM devices in
      stress tests, we end-up testing a state that is being modified. That
      can't be good.
      
      b) there is a conceptual deadlock: on stop we check the FE states to
      see if a shared BE can be stopped, but since we trigger the BE first
      the FE states have not been modified yet, so the TRIGGER_STOP is never
      sent.
      
      This patchset suggests the removal of the dedicated 'dpcm_lock' and
      follows the design suggested by Takashi Iwai.  By default the
      protection relies on the 'pcm_mutex', except for the FE and BE
      triggers where the mutex cannot be used.  In this case, the FE PCM
      lock is used instead. In the cases where a BE is added/removed, the
      pcm_mutex and FE PCM lock are both taken.  In addition, the BE PCM
      lock is used to serialize access to a shared BE.
      
      With these patches I am able to run our entire validation suite
      without any issues with this new 'deep buffer' topology, and no
      regressions on existing solutions [1]. The tests were reproduced by
      Bard Liao for SoundWire devices.
      
      One might ask 'how come we didn't see this earlier'? The answer is
      probably that the .trigger callbacks in most implementations seems to
      perform DAPM operations, and sending the triggers multiple times is
      not an issue. In the case of SoundWire, we do use the .trigger
      callback to reconfigure the bus using the 'bank switch' mechanism. It
      could be acceptable to tolerate a trigger multiple times, but the
      deadlock on stop cannot be fixed at the SoundWire level alone.
      
      Opens:
      
      1) The issues reported by Nvidia on the RFCv3 may or may not be
      present. We'd need test results to make sure the locking update does
      not introduce a regression on Tegra.
      
      2) There are other reports of kernel oopses [2] that seem related to
      the lack of protection. I'd be good to confirm if this patchset solve
      these problems as well.
      
      [1] https://github.com/thesofproject/linux/pull/3146
      [2] https://lore.kernel.org/alsa-devel/002f01d7b4f5$c030f4a0$4092dde0$@samsung.com/
      
      changes since RFCv3:
      Used two patches from Takashi. We now use the pcm_mutex, the FE stream
      lock when adding and deleting a BE, and the BE stream lock to handle
      concurrency between streams using the same BE.
      Added a patch to use GFP_ATOMIC for the DPCM structure.
      Fixed PAUSE_RELEASE transition (GitHub comment from Kai Vehmanen)
      
      changes since RFCv2:
      Removal of dpcm_lock to use FE PCM locks (credits to Takashi Iwai for
      the suggestion). The FE PCM lock is now used before each use of
      for_each_dpcm_be() - with the exception of the trigger where the lock
      is already taken. This change is also applied in drivers which make
      use of this loop (compress, SH, FSL).
      Addition of BE PCM lock to deal with mutual exclusion between triggers
      for the same BE.
      Alignment of the BE atomicity on the FE on connections, this is
      required to avoid sleeping in atomic context.
      Additional cleanups (indentation, static functions)
      
      changes since RFC v1:
      Removed unused function
      Removed exported symbols only used in soc-pcm.c, used static instead
      Use a mutex instead of a spinlock
      Protect all for_each_dpcm_be() loops
      Fix bugs introduced in the refcount
      
      Pierre-Louis Bossart (4):
        ASoC: soc-pcm: use GFP_ATOMIC for dpcm structure
        ASoC: soc-pcm: align BE 'atomicity' with that of the FE
        ASoC: soc-pcm: test refcount before triggering
        ASoC: soc-pcm: fix BE handling of PAUSE_RELEASE
      
      Takashi Iwai (2):
        ASoC: soc-pcm: Fix and cleanup DPCM locking
        ASoC: soc-pcm: serialize BE triggers
      
       include/sound/soc-dpcm.h |   2 +
       include/sound/soc.h      |   2 -
       sound/soc/soc-core.c     |   1 -
       sound/soc/soc-pcm.c      | 351 +++++++++++++++++++++++++++------------
       4 files changed, 246 insertions(+), 110 deletions(-)
      
      --
      2.25.1
      9e376b14
  2. 14 Dec, 2021 12 commits
  3. 13 Dec, 2021 12 commits
  4. 09 Dec, 2021 2 commits
  5. 08 Dec, 2021 7 commits
  6. 06 Dec, 2021 2 commits
    • Mark Brown's avatar
      ASoC: fsl-asoc-card: Add missing Kconfig option for tlv320aic31xx · 3c732b64
      Mark Brown authored
      Merge series from Ariel D'Alessandro <ariel.dalessandro@collabora.com>:
      
      This is a follow up of patchsets:
      
        [RFC patch 0/5] Support BCLK input clock in tlv320aic31xx
        [PATCH 0/4] fsl-asoc-card: Add optional dt property for setting mclk-id
      
      Patch "ASoC: fsl-asoc-card: Support fsl,imx-audio-tlv320aic31xx codec"
      in "[RFC patch 0/5] Support BCLK input clock in tlv320aic31xx" missed a
      Kconfig option. Sending incremental patch fix.
      
      Regards,
      Ariel
      
      Ariel D'Alessandro (1):
        ASoC: fsl-asoc-card: Add missing Kconfig option for tlv320aic31xx
      
       sound/soc/fsl/Kconfig | 1 +
       1 file changed, 1 insertion(+)
      
      --
      2.30.2
      3c732b64
    • Mark Brown's avatar
      ASoC: mediatek: support memory-region assignment · 6e2127dc
      Mark Brown authored
      Merge series from Trevor Wu <trevor.wu@mediatek.com>:
      
      This series of patches adds support for memory-region assignment, so the
      access region of DMA engine could be restricted.
      Patches are based on broonie tree "for-next" branch.
      
      Trevor Wu (2):
        ASoC: mediatek: mt8195: support reserved memory assignment
        dt-bindings: mediatek: mt8195: add memory-region property
      
       .../devicetree/bindings/sound/mt8195-afe-pcm.yaml         | 8 ++++++++
       sound/soc/mediatek/mt8195/mt8195-afe-pcm.c                | 7 +++++++
       2 files changed, 15 insertions(+)
      
      --
      2.18.0
      6e2127dc