1. 30 May, 2022 2 commits
  2. 26 May, 2022 1 commit
  3. 24 May, 2022 1 commit
  4. 23 May, 2022 3 commits
  5. 20 May, 2022 5 commits
    • Mark Brown's avatar
      ASoC: SOF: Introduce generic (in)firmware tracing infrastructure · e5cd20e0
      Mark Brown authored
      Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
      From the kernel point of view there are only few ops that needs to be exposed:
      
      Hi,
      
      SOF is using dma-trace (or dtrace) as a firmware tracing method, which is only
      supported with IPC3 and it is not applicable for IPC4.
      
      Currently the dtrace is 'open managed' regardless of IPC version (we do force
      disable it for IPC4, but the dtrace calls remain in place).
      
      From the kernel point of view there are only few ops that needs to be exposed
      by the firmware tracing support and everything else is IPC private, should not
      be known by the core.
      
      This series converts the current dma-trace as ipc3 specific firmware tracing
      sub-component and moves all private data out from generic code.
      
      Regards,
      Peter
      ---
      Peter Ujfalusi (8):
        ASoC: SOF: Introduce IPC independent ops for firmware tracing support
        ASoC: SOF: Rename dtrace_is_supported flag to fw_trace_is_supported
        ASoC: SOF: Clone the trace code to ipc3-dtrace as fw_tracing
          implementation
        ASoC: SOF: Switch to IPC generic firmware tracing
        ASoC: SOF: ipc3-dtrace: Move host ops wrappers from generic header to
          private
        ASoC: SOF: Modify the host trace_init parameter list to include dmab
        ASoC: SOF: Introduce opaque storage of private data for firmware
          tracing
        ASoC: SOF: ipc3-dtrace: Move dtrace related variables local from
          sof_dev
      
       sound/soc/sof/Makefile          |   1 +
       sound/soc/sof/amd/acp-trace.c   |   4 +-
       sound/soc/sof/amd/acp.h         |   2 +-
       sound/soc/sof/core.c            |  13 +-
       sound/soc/sof/debug.c           |   2 +-
       sound/soc/sof/intel/hda-dsp.c   |   2 +-
       sound/soc/sof/intel/hda-trace.c |   4 +-
       sound/soc/sof/intel/hda.h       |   2 +-
       sound/soc/sof/ipc.c             |   6 +
       sound/soc/sof/ipc3-dtrace.c     | 649 ++++++++++++++++++++++++++++++++
       sound/soc/sof/ipc3-priv.h       |  38 ++
       sound/soc/sof/ipc3.c            |   3 +-
       sound/soc/sof/ops.c             |   2 +-
       sound/soc/sof/ops.h             |  26 --
       sound/soc/sof/pm.c              |   8 +-
       sound/soc/sof/sof-priv.h        |  53 +--
       sound/soc/sof/trace.c           | 621 ++----------------------------
       17 files changed, 767 insertions(+), 669 deletions(-)
       create mode 100644 sound/soc/sof/ipc3-dtrace.c
      
      --
      2.36.1
      e5cd20e0
    • Alexey Khoroshilov's avatar
      ASoC: max98090: Move check for invalid values before casting in max98090_put_enab_tlv() · f7a34446
      Alexey Khoroshilov authored
      Validation of signed input should be done before casting to unsigned int.
      
      Found by Linux Verification Center (linuxtesting.org) with SVACE.
      Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
      Suggested-by: default avatarMark Brown <broonie@kernel.org>
      Fixes: 2fbe467b ("ASoC: max98090: Reject invalid values in custom control put()")
      Link: https://lore.kernel.org/r/1652999486-29653-1-git-send-email-khoroshilov@ispras.ruSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      f7a34446
    • Shuming Fan's avatar
      ASoC: rt1308-sdw: add the default value of register 0xc320 · affa9983
      Shuming Fan authored
      The driver missed the default value of register 0xc320.
      This patch adds that default value to avoid the error messages
      when the driver went to suspend mode already.
      
      BugLink: https://github.com/thesofproject/linux/issues/3651Signed-off-by: default avatarShuming Fan <shumingf@realtek.com>
      Link: https://lore.kernel.org/r/20220520090205.25857-1-shumingf@realtek.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      affa9983
    • Mark Brown's avatar
      ASoC: SOF: mediatek: add debug dump · b4ce6dd4
      Mark Brown authored
      Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
      
      Add the ability to generate debug dumps on MediaTek SOF implementations.
      b4ce6dd4
    • Mark Brown's avatar
      ASoC: remove two unnecessary gpiolib dependencies · bb94bb86
      Mark Brown authored
      Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
      
      Remove two dependencies - issues reported by Intel kernel test bot.
      bb94bb86
  6. 19 May, 2022 20 commits
  7. 17 May, 2022 8 commits
    • Mark Brown's avatar
      ASoC: Intel: avs: Driver core and PCM operations · ec432e2a
      Mark Brown authored
      Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:
      
      Part three of main AVS driver series. This series was originally part of
      the initial series which was later divided [1] into smaller,
      easier-to-review chunks. Thus, many patches found here were already
      present on the list.
      
      This series consists of code typical to many drivers - PCI driver
      operations, trace ability, PM operations - as well as PCM handlers for
      all standard audio interfaces, that is, HDA, I2S and DMIC are found
      here.
      
      Series starts with updating firmware boot flow - libraries are no longer
      ignored. This change is dependent on already merged topology code [2]
      and because of that could not be part of the initial series [1].
      
      PCM operations are split into four changes. First component operations
      alone i.e. operations which are usually agnostic towards path position
      (FE/BE). Then it continues with "generic" FE operations - there is no
      interface split here as from Intel ADSP point of view, FE, or HOST side
      as it's called in the specs, involves HD-Audio operations only.
      BE (also known as LINK) side on the other hand is divided into
      "non-HD-Audio" and HD-Audio part. The former represents transfer over
      DMIC and I2S interfaces both.
      
      While patches implementing standard PCI driver operations along (again
      standard) HD-Audio initialization routines followed up by power
      management handlers are two major ones, series covers also other
      important subjects such as:
      
      While patches implementing standard PCI driver operations along (again
      standard) HD-Audio initialization routines followed up by power
      management handlers are two major ones, series covers also other
      important subjects such as:
      
      - event tracing
      - preparation for firmware tracing (debugability)
      - coredump (debugability)
      - recovery flow (attempt recovery after IPC timeout or exception)
      - D0ix (D0 device substate, complements standard power management)
      
      Series is finalized by actual addition of supported platforms: SKL and
      APL-based. Platform-specific files are limited to firmware-specific
      bits, that is, bits that are specific to given firmware generation.
      Everything else is shared and is part of already upstream messaging
      code found in ipc.c, messages.c and messages.h files.
      
      Changes in v3:
      - addressed (hopefully) trace-code compilation under .configs with
        CONFIG_FTRACE dropped
      
      Changes in v2:
      - usage of avs_releast_last_firmware() dropped in error path for library
        loading procedure as suggested by Pierre
      - 'link_mask' usage replaced with 'i2s_link_mask' as requested by
        Pierre. Existing code addressed with new patch:
        "ASoC: Intel: avs: Replace link_mask usage with i2s_link_mask"
      - fixed possible race during recovery flow (->recovering flag is now
        atomic and tested in single location only).
      - dropped platform prefixes for basically all i2s board descriptors
      - 'ssp_test' renamed to 'i2s_test' to match naming convention of other
        boards
      - simplified PM implementation for current series, 'low_power' bits
        moved to future series
      - replaced SND_INTEL_DSP_DRIVER_SST with _AVS as suggested by Mark.
        Required changes to intel-dspcfg will be added in future series
      - number of typos across commit messages addressed
      
      [1]: https://lore.kernel.org/all/20220311153544.136854-1-cezary.rojewski@intel.com/
      [2]: https://lore.kernel.org/all/20220331135246.993089-1-cezary.rojewski@intel.com/
      
      Cezary Rojewski (14):
        ASoC: Intel: avs: Account for libraries when booting basefw
        ASoC: Intel: avs: Generic soc component driver
        ASoC: Intel: avs: Generic PCM FE operations
        ASoC: Intel: avs: non-HDA PCM BE operations
        ASoC: Intel: avs: HDA PCM BE operations
        ASoC: Intel: avs: Coredump and recovery flow
        ASoC: Intel: avs: Prepare for firmware tracing
        ASoC: Intel: avs: D0ix power state support
        ASoC: Intel: avs: Event tracing
        ASoC: Intel: avs: Machine board registration
        ASoC: Intel: avs: PCI driver implementation
        ASoC: Intel: avs: Power management
        ASoC: Intel: avs: SKL-based platforms support
        ASoC: Intel: avs: APL-based platforms support
      
      Piotr Maziarz (1):
        ASoC: Intel: avs: Replace link_mask usage with i2s_link_mask
      
       include/sound/intel-dsp-config.h      |    3 +-
       include/sound/soc-acpi.h              |    2 +
       sound/soc/intel/Kconfig               |    2 +
       sound/soc/intel/avs/Makefile          |    7 +-
       sound/soc/intel/avs/apl.c             |  250 ++++++
       sound/soc/intel/avs/avs.h             |   79 ++
       sound/soc/intel/avs/board_selection.c |  501 +++++++++++
       sound/soc/intel/avs/core.c            |  631 +++++++++++++
       sound/soc/intel/avs/dsp.c             |   27 +-
       sound/soc/intel/avs/ipc.c             |  253 +++++-
       sound/soc/intel/avs/loader.c          |   84 ++
       sound/soc/intel/avs/messages.c        |   35 +-
       sound/soc/intel/avs/messages.h        |   51 ++
       sound/soc/intel/avs/pcm.c             | 1182 +++++++++++++++++++++++++
       sound/soc/intel/avs/registers.h       |    8 +
       sound/soc/intel/avs/skl.c             |  125 +++
       sound/soc/intel/avs/topology.c        |   14 +-
       sound/soc/intel/avs/trace.c           |   33 +
       sound/soc/intel/avs/trace.h           |  154 ++++
       sound/soc/intel/avs/utils.c           |   23 +
       20 files changed, 3443 insertions(+), 21 deletions(-)
       create mode 100644 sound/soc/intel/avs/apl.c
       create mode 100644 sound/soc/intel/avs/board_selection.c
       create mode 100644 sound/soc/intel/avs/pcm.c
       create mode 100644 sound/soc/intel/avs/skl.c
       create mode 100644 sound/soc/intel/avs/trace.c
       create mode 100644 sound/soc/intel/avs/trace.h
      
      --
      2.25.1
      ec432e2a
    • Yihao Han's avatar
      ASoC: ux500: mop500: Check before clk_put() not needed · 37a86b32
      Yihao Han authored
      clk_put() already checks the clk ptr using !clk and IS_ERR()
      so there is no need to check it again before calling it.
      Signed-off-by: default avatarYihao Han <hanyihao@vivo.com>
      Link: https://lore.kernel.org/r/20220517033050.5191-1-hanyihao@vivo.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      37a86b32
    • Peter Ujfalusi's avatar
      ASoC: SOF: ipc-msg-injector: Cap the rmaining to count in IPC4 mode · c5003f08
      Peter Ujfalusi authored
      If user space provides smaller buffer than the IPC4 reply then it is
      possible that we corrupt user space memory since the IPC4 dfs_read function
      is not using the count directly in copy_to_user() due to the nature of
      an IPC4 message.
      
      Cap the remaining counter to make sure that we are not writing too much to
      the user space provided buffer.
      
      Add a check also to make sure that the buffer is at least the size of the
      IPC4 header.
      
      Fixes: 066c6762: "ASoC: SOF: ipc-msg-injector: Add support for IPC4 messages"
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
      Link: https://lore.kernel.org/r/20220516092442.17027-1-peter.ujfalusi@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      c5003f08
    • Cezary Rojewski's avatar
      ASoC: Intel: avs: APL-based platforms support · c8c960c1
      Cezary Rojewski authored
      Define handlers specific to cAVS 1.5+ platforms, that is, APL and
      similar platforms. These differ from SKL-alike ones in terms of AudioDSP
      firmware generation and thus the '+' suffix. Introduciton of IMR,
      removal of CLDMA, D0IX support and monolithic-ation of library/module
      code are most impactful but are not the only changes brought with this
      newer generation. Some generic and 1.5 operations are being re-used to
      reduce code size.
      Signed-off-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
      Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
      Link: https://lore.kernel.org/r/20220516101116.190192-16-cezary.rojewski@intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      c8c960c1
    • Cezary Rojewski's avatar
      ASoC: Intel: avs: SKL-based platforms support · b3e29075
      Cezary Rojewski authored
      Define handlers specific to cAVS 1.5 platforms, that is SKL, KBL, AML
      and all other variants based on this very version of AudioDSP
      architecture. Most are specific to SKL-alike platforms with only
      skl_log_buffer_offset() being exposed and used later by younger
      equivalents.
      Signed-off-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
      Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
      Link: https://lore.kernel.org/r/20220516101116.190192-15-cezary.rojewski@intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      b3e29075
    • Cezary Rojewski's avatar
      ASoC: Intel: avs: Power management · cfbc100e
      Cezary Rojewski authored
      To preserve power during sleep operations, handle suspend (S3),
      hibernation (S4) and runtime (RTD3) transitions. As flow for all of
      is shared, define common handlers to reduce code size.
      Signed-off-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
      Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
      Link: https://lore.kernel.org/r/20220516101116.190192-14-cezary.rojewski@intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      cfbc100e
    • Cezary Rojewski's avatar
      ASoC: Intel: avs: PCI driver implementation · 1affc44e
      Cezary Rojewski authored
      HD-Audio bus is a PCI device. Add all functions necessary to probe such
      device along with its removal sequence. Behaviour implemented for all
      standard operations is similar to existing solutions: sound/pci/hda and
      sound/soc/intel/skylake.
      Signed-off-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
      Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
      Link: https://lore.kernel.org/r/20220516101116.190192-13-cezary.rojewski@intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      1affc44e
    • Cezary Rojewski's avatar
      ASoC: Intel: avs: Machine board registration · beed9836
      Cezary Rojewski authored
      AVS driver operates with granular audio card division in mind.
      Super-card approach (e.g.: I2S, DMIC and HDA DAIs combined) is
      deprecated in favour of individual cards - one per each device. This
      provides necessary dynamism, especially for configurations with number
      of codecs present and makes it easier to survive auxiliary devices
      failures - one card failing to probe does not prevent others from
      succeeding.
      
      All boards spawned by AVS are unregistered on ->remove(). This includes
      dummy codecs such as DMIC.
      
      As all machine boards found in sound/soc/intel/boards are irreversibly
      tied to 'super-card' approach, new boards are going to be introduced.
      This temporarily increases number of boards available under /intel
      directory until skylake-driver becomes deprecated and removed.
      Signed-off-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
      Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
      Link: https://lore.kernel.org/r/20220516101116.190192-12-cezary.rojewski@intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      beed9836