1. 15 Dec, 2021 4 commits
    • Peter Ujfalusi's avatar
      ASoC: SOF: ipc: Rename send parameter in snd_sof_ipc_set_get_comp_data() · 9d562fdc
      Peter Ujfalusi authored
      Rename the send parameter to set in snd_sof_ipc_set_get_comp_data() and
      sof_set_get_large_ctrl_data() to be more aligned with the function name.
      
      No functional change.
      Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
      Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
      Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Signed-off-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
      Link: https://lore.kernel.org/r/20211215180404.53254-2-ranjani.sridharan@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      9d562fdc
    • 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 3 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
    • Mark Brown's avatar
      ASoC: mediatek: Update MT8195 machine driver · c736d64d
      Mark Brown authored
      Merge series from Trevor Wu <trevor.wu@mediatek.com>:
      
      This series of patches adds support for RT5682s headset codec in mt8195
      machine drivers, and SOF support on card mt8195-mt6359-rt1019-rt5682 is
      also included.
      Patches are based on broonie tree "for-next" branch.
      
      Changes since v1:
        - remove patch3 and patch4 in v1
        - add SOF support on card mt8195-mt6359-rt1012-rt5682
        - add new propertes to dt-bindings for mt8195-mt6359-rt1019-rt5682
      
      Trevor Wu (4):
        ASoC: mediatek: mt8195: add headset codec rt5682s support
        dt-bindings: mediatek: mt8195: add model property
        ASoC: mediatek: mt8195: add sof support on mt8195-mt6359-rt1019-rt5682
        dt-bindings: mediatek: mt8195: add adsp and dai-link property
      
       .../sound/mt8195-mt6359-rt1011-rt5682.yaml    |   4 +
       .../sound/mt8195-mt6359-rt1019-rt5682.yaml    |  14 +
       sound/soc/mediatek/Kconfig                    |   2 +
       .../mt8195/mt8195-mt6359-rt1011-rt5682.c      |  29 +-
       .../mt8195/mt8195-mt6359-rt1019-rt5682.c      | 347 +++++++++++++++++-
       5 files changed, 370 insertions(+), 26 deletions(-)
      
      --
      2.18.0
      c736d64d