Skip to content
  1. Feb 03, 2022
  2. Jan 31, 2022
  3. Jan 29, 2022
    • Mark Brown's avatar
      ASoC: ops: Check for negative values before reading them · 1601033d
      Mark Brown authored
      
      
      The controls allow inputs to be specified as negative but our manipulating
      them into register fields need to be done on unsigned variables so the
      checks for negative numbers weren't taking effect properly. Do the checks
      for negative values on the variable in the ABI struct rather than on our
      local unsigned copy.
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Link: https://lore.kernel.org/r/20220128192443.3504823-1-broonie@kernel.org
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      1601033d
    • Mark Brown's avatar
      ASoC DPCM lockdep fixes · 4c38f874
      Mark Brown authored
      Merge series from Takashi Iwai <tiwai@suse.de>:
      
      This is the revised patches for addressing ASoC lockdep warnings due
      to the recent DPCM locking refactoring.
      4c38f874
  4. Jan 28, 2022
    • Peter Ujfalusi's avatar
      ASoC: rt5682: Fix deadlock on resume · 4045daf0
      Peter Ujfalusi authored
      On resume from suspend the following chain of events can happen:
      A rt5682_resume() -> mod_delayed_work() for jack_detect_work
      B DAPM sequence starts ( DAPM is locked now)
      
      A1. rt5682_jack_detect_handler() scheduled
       - Takes both jdet_mutex and calibrate_mutex
       - Calls in to rt5682_headset_detect() which tries to take DAPM lock, it
         starts to wait for it as B path took it already.
      B1. DAPM sequence reaches the "HP Amp", rt5682_hp_event() tries to take
          the jdet_mutex, but it is locked in A1, so it waits.
      
      Deadlock.
      
      To solve the deadlock, drop the jdet_mutex, use the jack_detect_work to do
      the jack removal handling, move the dapm lock up one level to protect the
      most of the rt5682_jack_detect_handler(), but not the jack reporting as it
      might trigger a DAPM sequence.
      The rt5682_headset_detect() can be changed to static as well.
      
      Fixes: 8deb34a9
      
       ("ASoC: rt5682: fix the wrong jack type detected")
      Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
      Link: https://lore.kernel.org/r/20220126100325.16513-1-peter.ujfalusi@linux.intel.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      4045daf0
    • Dmitry Osipenko's avatar
      ASoC: hdmi-codec: Fix OOB memory accesses · 06feec60
      Dmitry Osipenko authored
      
      
      Correct size of iec_status array by changing it to the size of status
      array of the struct snd_aes_iec958. This fixes out-of-bounds slab
      read accesses made by memcpy() of the hdmi-codec driver. This problem
      is reported by KASAN.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDmitry Osipenko <digetx@gmail.com>
      Link: https://lore.kernel.org/r/20220112195039.1329-1-digetx@gmail.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      06feec60
    • Takashi Iwai's avatar
      ASoC: soc-pcm: Move debugfs removal out of spinlock · 9f620684
      Takashi Iwai authored
      The recent fix for DPCM locking also covered the loop in
      dpcm_be_disconnect() with the FE stream lock.  This caused an
      unexpected side effect, thought: calling debugfs_remove_recursive() in
      the spinlock may lead to lockdep splats as the code there assumes the
      SOFTIRQ-safe context.
      
      For avoiding the problem, this patch changes the disconnection
      procedure to two phases: at first, the matching entries are removed
      from the linked list, then the resources are freed outside the lock.
      
      Fixes: b7898396
      
       ("ASoC: soc-pcm: Fix and cleanup DPCM locking")
      Reported-and-tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Link: https://lore.kernel.org/r/20220119155249.26754-3-tiwai@suse.de
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      9f620684
    • Takashi Iwai's avatar
      ASoC: soc-pcm: Fix DPCM lockdep warning due to nested stream locks · 3c75c0ea
      Takashi Iwai authored
      The recent change for DPCM locking caused spurious lockdep warnings.
      Actually the warnings are false-positive, as those are triggered due
      to the nested stream locks for FE and BE.  Since both locks belong to
      the same lock class, lockdep sees it as if a deadlock.
      
      For fixing this, we need to take PCM stream locks for BE with the
      nested lock primitives.  Since currently snd_pcm_stream_lock*() helper
      assumes only the top-level single locking, a new helper function
      snd_pcm_stream_lock_irqsave_nested() is defined for a single-depth
      nested lock, which is now used in the BE DAI trigger that is always
      performed inside a FE stream lock.
      
      Fixes: b2ae8066
      
       ("ASoC: soc-pcm: serialize BE triggers")
      Reported-and-tested-by: default avatarHans de Goede <hdegoede@redhat.com>
      Reported-and-tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Link: https://lore.kernel.org/r/73018f3c-9769-72ea-0325-b3f8e2381e30@redhat.com
      Link: https://lore.kernel.org/alsa-devel/9a0abddd-49e9-872d-2f00-a1697340f786@samsung.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Link: https://lore.kernel.org/r/20220119155249.26754-2-tiwai@suse.de
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      3c75c0ea
    • Miaoqian Lin's avatar
      ASoC: fsl: Add missing error handling in pcm030_fabric_probe · fb25621d
      Miaoqian Lin authored
      Add the missing platform_device_put() and platform_device_del()
      before return from pcm030_fabric_probe in the error handling case.
      
      Fixes: c912fa91
      
       ("ASoC: fsl: register the wm9712-codec")
      Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
      Link: https://lore.kernel.org/r/20220127131336.30214-1-linmq006@gmail.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      fb25621d
  5. Jan 26, 2022
  6. Jan 25, 2022
  7. Jan 22, 2022
  8. Jan 20, 2022
    • Julian Braha's avatar
      ASoC: mediatek: fix unmet dependency on GPIOLIB for SND_SOC_DMIC · 579b2c8f
      Julian Braha authored
      
      
      When SND_SOC_MT8195_MT6359_RT1011_RT5682 is selected,
      and GPIOLIB is not selected,
      Kbuild gives the following warning:
      
      WARNING: unmet direct dependencies detected for SND_SOC_DMIC
        Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n]
        Selected by [y]:
        - SND_SOC_MT8195_MT6359_RT1011_RT5682 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=y] && SND_SOC_MT8195 [=y] && MTK_PMIC_WRAP [=y]
      
      This is because SND_SOC_MT8195_MT6359_RT1011_RT5682
      selects SND_SOC_DMIC without selecting or depending on
      GPIOLIB, depsite SND_SOC_DMIC depending on GPIOLIB.
      
      This unmet dependency bug was detected by Kismet,
      a static analysis tool for Kconfig. Please advise
      if this is not the appropriate solution.
      
      Signed-off-by: default avatarJulian Braha <julianbraha@gmail.com>
      Reviewed-by: default avatarTzung-Bi Shih <tzungbi@google.com>
      Link: https://lore.kernel.org/r/20220117050324.68371-1-julianbraha@gmail.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      579b2c8f
    • Dan Carpenter's avatar
      ASoC: max9759: fix underflow in speaker_gain_control_put() · 4c907bcd
      Dan Carpenter authored
      Check for negative values of "priv->gain" to prevent an out of bounds
      access.  The concern is that these might come from the user via:
        -> snd_ctl_elem_write_user()
          -> snd_ctl_elem_write()
            -> kctl->put()
      
      Fixes: fa8d9151
      
       ("ASoC: max9759: Add Amplifier Driver")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Link: https://lore.kernel.org/r/20220119123101.GA9509@kili
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      4c907bcd
  9. Jan 12, 2022
  10. Jan 11, 2022
    • Robert Hancock's avatar
      ASoC: simple-card: fix probe failure on platform component · a64067f4
      Robert Hancock authored
      A previous change to simple-card resulted in asoc_simple_parse_dai
      attempting to retrieve the dai_name for platform components, which are
      unlikely to have a valid DAI name. This caused simple-card to fail to
      probe when using the xlnx_formatter_pcm as the platform component, since
      it does not register any DAI components.
      
      Since the dai_name is not used for platform components, just skip trying
      to retrieve it for those.
      
      Fixes: f107294c
      
       ("ASoC: simple-card: support snd_soc_dai_link_component style for cpu")
      Signed-off-by: default avatarRobert Hancock <robert.hancock@calian.com>
      Link: https://lore.kernel.org/r/20220107214711.1100162-6-robert.hancock@calian.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      a64067f4
  11. Jan 10, 2022
    • Robert Hancock's avatar
      ASoC: xilinx: xlnx_formatter_pcm: Make buffer bytes multiple of period bytes · e958b588
      Robert Hancock authored
      This patch is based on one in the Xilinx kernel tree, "ASoc: xlnx: Make
      buffer bytes multiple of period bytes" by Devarsh Thakkar. The same
      issue exists in the mainline version of the driver. The original
      patch description is as follows:
      
      "The Xilinx Audio Formatter IP has a constraint on period
      bytes to be multiple of 64. This leads to driver changing
      the period size to suitable frames such that period bytes
      are multiple of 64.
      
      Now since period bytes and period size are updated but not
      the buffer bytes, this may make the buffer bytes unaligned
      and not multiple of period bytes.
      
      When this happens we hear popping noise as while DMA is being
      done the buffer bytes are not enough to complete DMA access
      for last period of frame within the application buffer boundary.
      
      To avoid this, align buffer bytes too as multiple of 64, and
      set another constraint to always enforce number of periods as
      integer. Now since, there is already a rule in alsa core
      to enforce Buffer size = Number of Periods * Period Size
      this automatically aligns buffer bytes as multiple of period
      bytes."
      
      Fixes: 6f6c3c36
      
       ("ASoC: xlnx: add pcm formatter platform driver")
      Cc: Devarsh Thakkar <devarsh.thakkar@xilinx.com>
      Signed-off-by: default avatarRobert Hancock <robert.hancock@calian.com>
      Link: https://lore.kernel.org/r/20220107214711.1100162-2-robert.hancock@calian.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      e958b588
  12. Jan 08, 2022
  13. Jan 07, 2022
  14. Jan 06, 2022