Skip to content
  1. Dec 22, 2022
  2. Dec 09, 2022
    • Kai Vehmanen's avatar
      ALSA: hda/hdmi: fix stream-id config keep-alive for rt suspend · ee0b089d
      Kai Vehmanen authored
      When the new style KAE keep-alive implementation is used on compatible
      Intel hardware, the clocks are maintained when codec is in D3. The
      generic code in hda_cleanup_all_streams() can however interfere with
      generation of audio samples in this mode, by setting the stream and
      channel ids to zero.
      
      To get full benefit of the keepalive, set the new
      no_stream_clean_at_suspend quirk bit on affected Intel hardware. When
      this bit is set, stream cleanup is skipped in hda_call_codec_suspend().
      
      Special handling is needed for the case when system goes to suspend. The
      stream id programming can be lost in this case. This will also cause
      codec->cvt_setups to be out of sync. Handle this by implementing custom
      suspend/resume handlers. If keep-alive is active for any converter, set
      the quirk flags no_stream_clean_at_suspend and forced_resume. Upon
      resume, keepalive programming is restored if needed.
      
      Fixes: 15175a4f
      
       ("ALSA: hda/hdmi: add keep-alive support for ADL-P and DG2")
      Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Link: https://lore.kernel.org/r/20221209101822.3893675-4-kai.vehmanen@linux.intel.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      ee0b089d
    • Kai Vehmanen's avatar
      ALSA: hda/hdmi: set default audio parameters for KAE silent-stream · b17e7ea0
      Kai Vehmanen authored
      If the stream-id is zero, the keep-alive (KAE) will only ensure clock is
      generated, but no audio samples are sent over display link. This happens
      before first real audio stream is played out to a newly connected
      receiver.
      
      Reuse the code in silent_stream_enable() to set up stream parameters
      to sane defaults values, also when using the newer keep-alive flow.
      
      Fixes: 15175a4f
      
       ("ALSA: hda/hdmi: add keep-alive support for ADL-P and DG2")
      Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Tested-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://lore.kernel.org/r/20221209101822.3893675-3-kai.vehmanen@linux.intel.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      b17e7ea0
    • Kai Vehmanen's avatar
      ALSA: hda/hdmi: fix i915 silent stream programming flow · ada261b6
      Kai Vehmanen authored
      The i915 display codec may not successfully transition to
      normal audio streaming mode, if the stream id is programmed
      while codec is actively transmitting data. This can happen
      when silent stream is enabled in KAE mode.
      
      Fix the issue by implementing a i915 specific programming
      flow, where the silent streaming is temporarily stopped,
      a small delay is applied to ensure display codec becomes
      idle, and then proceed with reprogramming the stream ID.
      
      Fixes: 15175a4f
      
       ("ALSA: hda/hdmi: add keep-alive support for ADL-P and DG2")
      Link: https://gitlab.freedesktop.org/drm/intel/-/issues/7353
      Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Tested-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://lore.kernel.org/r/20221209101822.3893675-2-kai.vehmanen@linux.intel.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      ada261b6
    • Cezary Rojewski's avatar
      ALSA: hda: Error out if invalid stream is being setup · 084ca216
      Cezary Rojewski authored
      Scenario when snd_hdac_stream_setup_periods() receives an instance of
      struct hdac_stream with neither ->substream nor ->cstream initialized is
      invalid.
      
      Simultaneously addresses "uninitialized symbol 'dmab'" error reported by
      Smatch.
      
      Fixes: 3e958226
      
       ("ALSA: hda: Interrupt servicing and BDL setup for compress streams")
      Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
      Link: https://lore.kernel.org/r/20221208142635.1514944-1-cezary.rojewski@intel.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      084ca216
    • Takashi Iwai's avatar
      Merge tag 'asoc-v6.2-2' of... · a587601b
      Takashi Iwai authored
      Merge tag 'asoc-v6.2-2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
      
      ASoC: Updates for v6.2
      
      A few more updates for v6.2 which can hopefully go into a later pull
      request, the bulk of these are fixes, minor cleanups or new board quirks
      - the one big bit that isn't is support for getting diagnostic data out
      of the Intel AVS firmwares.
      a587601b
  3. Dec 08, 2022
    • Marek Vasut's avatar
      ASoC: dt-bindings: fsl-sai: Reinstate i.MX93 SAI compatible string · e85b1f5a
      Marek Vasut authored
      The ASoC: dt-bindings: fsl-sai: Fix mx6ul and mx7d compatible strings
      dropped i.MX93 SAI compatible string, reinstate it.
      
      Fixes: 81b6c043
      
       ("ASoC: dt-bindings: fsl-sai: Fix mx6ul and mx7d compatible strings")
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Link: https://lore.kernel.org/r/20221208035354.255438-1-marex@denx.de
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      e85b1f5a
    • Chancel Liu's avatar
      ASoC: soc-pcm.c: Clear DAIs parameters after stream_active is updated · 1da681e5
      Chancel Liu authored
      
      
      DAIs parameters should be cleared if there's no active stream. Before,
      we implemented it in soc_pcm_hw_free() by detecting stream_active. If
      the running stream is the last active stream, we're going to clear
      parameters.
      
      However it will cause DAIs parameters never be cleared if there're
      more than one stream. For example, we have stream1 and stream2 about
      to stop. stream2 executes soc_pcm_hw_free() before stream1 executes
      soc_pcm_close(). At the moment, stream2 should clear DAIs parameters.
      Since stream_active is not yet updated by stream1 in soc_pcm_close(),
      stream2 will not clear DAIs parameters. In result both stream1 and
      stream2 don't clear the parameters.
      
      This patch moves DAIs parameters cleanup after stream_active is
      updated.
      
      Signed-off-by: default avatarChancel Liu <chancel.liu@nxp.com>
      Link: https://lore.kernel.org/r/20221128060950.3540845-1-chancel.liu@nxp.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      1da681e5
    • Jiapeng Chong's avatar
      ASoC: codecs: wcd-clsh: Remove the unused function · 81ed7d9d
      Jiapeng Chong authored
      
      
      The function wcd_clsh_set_buck_mode() is defined in the wcd-clsh-v2.c
      file, but not called elsewhere, so remove this unused function.
      
      sound/soc/codecs/wcd-clsh-v2.c:133:20: warning: unused function 'wcd_clsh_enable_status'.
      
      Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3348
      Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
      Signed-off-by: default avatarJiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Link: https://lore.kernel.org/r/20221205073507.36071-1-jiapeng.chong@linux.alibaba.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      81ed7d9d
    • Mark Brown's avatar
      ASoC: Intel: boards: updates for SOF boards · 122d851b
      Mark Brown authored
      Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
      
      One new JasperLake configuration, core refactoring between RT1316 and
      RT1318 and a minor uninitialized variable corner case.
      122d851b
    • Mark Brown's avatar
      ASoC: Intel: Skylake: Topology and shutdown fixes · 4f143eca
      Mark Brown authored
      Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:
      
      Even though skylake-driver is going to be replaced by the avs-driver,
      the goal is to keep it functional on all the configurations it supports
      until its EOL. When comparing chrome trees against upstream
      skylake-driver, couple fixes pop up that are not part of upstream
      repository. These fixes are backed up by real bugs (issue trackers),
      address real problems. There is no reason for them to stay in the
      internal tree.
      
      Patches 1-4 combined together address issue where the driver updates the
      presumably static audio format descriptions coming from the topology
      files through its "fixup" functions. As long as given audio format is
      used by a single path, nothing collides and any updates are harmless.
      However, when multiple paths e.g.: DMIC and HDMI1 utilize the same audio
      format descriptor, any updates caused by the opening of the first path,
      may cause the second to fail.
      
      The 5th change from the set fixes driver hang sporadically occurring
      during shutdown procedure. Once HDAudio links are powered down along
      with the AudioDSP, the hang stops reproducing.
      
      The last change helps survive in environments with limited/fragmented
      memory. While the BDL is small already, other buffers can be allocated
      using scatter-gather. This basically aligns the code with what the
      avs-driver does.
      4f143eca
  4. Dec 07, 2022
  5. Dec 06, 2022
    • Takashi Iwai's avatar
      Merge tag 'asoc-v6.2' of... · 8ec2d95f
      Takashi Iwai authored
      Merge tag 'asoc-v6.2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
      
      ASoC: Updates for v6.2
      
      This is a fairly sedate release for the core code, but there's been a
      lot of driver work especially around the x86 platforms and device tree
      updates:
      
       - More cleanups of the DAPM code from Morimoto-san.
       - Factoring out of mapping hw_params onto SoundWire configuration by
         Charles Keepax.
       - The ever ongoing overhauls of the Intel DSP code continue, including
         support for loading libraries and probes with IPC4 on SOF.
       - Support for more sample formats on JZ4740.
       - Lots of device tree conversions and fixups.
       - Support for Allwinner D1, a range of AMD and Intel systems, Mediatek
         systems with multiple DMICs, Nuvoton NAU8318, NXP fsl_rpmsg and
         i.MX93, Qualcomm AudioReach Enable, MFC and SAL, RealTek RT1318 and
         Rockchip RK3588
      
      There's more cross tree updates than usual, though all fairly minor:
      
       - Some OMAP board file updates that were depedencies for removing their
         providers in ASoC, as part of a wider effort removing the support for
         the relevant OMAP platforms.
       - A new I2C API required for updates to the new I2C probe API.
       - A DRM update making use of a new API for fixing the capabilities
         advertised via hdmi-codec.
      
      Since this is being sent early I might send some more stuff if you've
      not yet sent your pull request and there's more come in.
      8ec2d95f
    • Gaosheng Cui's avatar
      ALSA: mts64: fix possible null-ptr-defer in snd_mts64_interrupt · cf2ea3c8
      Gaosheng Cui authored
      I got a null-ptr-defer error report when I do the following tests
      on the qemu platform:
      
      make defconfig and CONFIG_PARPORT=m, CONFIG_PARPORT_PC=m,
      CONFIG_SND_MTS64=m
      
      Then making test scripts:
      cat>test_mod1.sh<<EOF
      modprobe snd-mts64
      modprobe snd-mts64
      EOF
      
      Executing the script, perhaps several times, we will get a null-ptr-defer
      report, as follow:
      
      syzkaller:~# ./test_mod.sh
      snd_mts64: probe of snd_mts64.0 failed with error -5
      modprobe: ERROR: could not insert 'snd_mts64': No such device
       BUG: kernel NULL pointer dereference, address: 0000000000000000
       #PF: supervisor write access in kernel mode
       #PF: error_code(0x0002) - not-present page
       PGD 0 P4D 0
       Oops: 0002 [#1] PREEMPT SMP PTI
       CPU: 0 PID: 205 Comm: modprobe Not tainted 6.1.0-rc8-00588-g76dcd734eca2 #6
       Call Trace:
        <IRQ>
        snd_mts64_interrupt+0x24/0xa0 [snd_mts64]
        parport_irq_handler+0x37/0x50 [parport]
        __handle_irq_event_percpu+0x39/0x190
        handle_irq_event_percpu+0xa/0x30
        handle_irq_event+0x2f/0x50
        handle_edge_irq+0x99/0x1b0
        __common_interrupt+0x5d/0x100
        common_interrupt+0xa0/0xc0
        </IRQ>
        <TASK>
        asm_common_interrupt+0x22/0x40
       RIP: 0010:_raw_write_unlock_irqrestore+0x11/0x30
        parport_claim+0xbd/0x230 [parport]
        snd_mts64_probe+0x14a/0x465 [snd_mts64]
        platform_probe+0x3f/0xa0
        really_probe+0x129/0x2c0
        __driver_probe_device+0x6d/0xc0
        driver_probe_device+0x1a/0xa0
        __device_attach_driver+0x7a/0xb0
        bus_for_each_drv+0x62/0xb0
        __device_attach+0xe4/0x180
        bus_probe_device+0x82/0xa0
        device_add+0x550/0x920
        platform_device_add+0x106/0x220
        snd_mts64_attach+0x2e/0x80 [snd_mts64]
        port_check+0x14/0x20 [parport]
        bus_for_each_dev+0x6e/0xc0
        __parport_register_driver+0x7c/0xb0 [parport]
        snd_mts64_module_init+0x31/0x1000 [snd_mts64]
        do_one_initcall+0x3c/0x1f0
        do_init_module+0x46/0x1c6
        load_module+0x1d8d/0x1e10
        __do_sys_finit_module+0xa2/0xf0
        do_syscall_64+0x37/0x90
        entry_SYSCALL_64_after_hwframe+0x63/0xcd
        </TASK>
       Kernel panic - not syncing: Fatal exception in interrupt
       Rebooting in 1 seconds..
      
      The mts wa not initialized during interrupt,  we add check for
      mts to fix this bug.
      
      Fixes: 68ab801e
      
       ("[ALSA] Add snd-mts64 driver for ESI Miditerminal 4140")
      Signed-off-by: default avatarGaosheng Cui <cuigaosheng1@huawei.com>
      Link: https://lore.kernel.org/r/20221206061004.1222966-1-cuigaosheng1@huawei.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      cf2ea3c8
    • Mark Brown's avatar
      ASoC: Intel: avs: Data probing and fw logging · 8e378ea1
      Mark Brown authored
      Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:
      
      The patchset focuses on debug functionality for the avs-driver.
      Two major blocks are covered here: data probing and AudioDSP firmware
      logging. Both are configured and controlled through debugfs.
      
      Data probing is a AudioDSP debug functionality which allows for
      gathering the actual data that is being routed to or from a module.
      Helps in debugging its processing capabilities - navigate to a specific
      module which may have caused a glitch within a pipeline (set of modules
      bound together).
      
      First few allow for assigning compress stream to a HDAudio stream, what
      is currently limited to pcm substreams only. These patches were already
      present on this list and reviewed in the past [1].
      
      The next few tidy existing debug-related code up so it's ready for
      addition of new functionalities and make it clear which part of the avs
      is debug related and which is not. These also simplify the existing
      locking around the trace fifo.
      
      Afterward, debug-related IPCs are defined along with stub soc-component
      and compress DAI operations. Not much is done there as it's not a
      standard PCM streaming scenario. Most code found in compress operations
      is inherited from the HOST side of HDAudio streaming found in pcm.c
      file of the driver.
      
      Finally, a debugfs file operations are defined. These facilitate
      connecting to DSP modules from which the data shall be gathered as well
      as control and configuration of firmware logging. Additionally, entries
      are added to allow for dumping snapshots of key memory windows.
      8e378ea1
    • Yang Yingliang's avatar
      ASoC: sof_es8336: fix possible use-after-free in sof_es8336_remove() · 1b41beaa
      Yang Yingliang authored
      sof_es8336_remove() calls cancel_delayed_work(). However, that
      function does not wait until the work function finishes. This
      means that the callback function may still be running after
      the driver's remove function has finished, which would result
      in a use-after-free.
      
      Fix by calling cancel_delayed_work_sync(), which ensures that
      the work is properly cancelled, no longer running, and unable
      to re-schedule itself.
      
      Fixes: 89cdb224
      
       ("ASoC: sof_es8336: reduce pop noise on speaker")
      Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
      Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Link: https://lore.kernel.org/r/20221205143721.3988988-1-yangyingliang@huawei.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      1b41beaa
    • Mark Brown's avatar
      Add SOF panic dump support for AMD platform. · 9472382d
      Mark Brown authored
      Merge series from V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>:
      
      Fix an issue with starting the ACP DSP and support debug dumps to aid
      maintainability.
      9472382d
    • Philipp Jungkamp's avatar
      ALSA: patch_realtek: Fix Dell Inspiron Plus 16 · 2912cdda
      Philipp Jungkamp authored
      
      
      The Dell Inspiron Plus 16, in both laptop and 2in1 form factor, has top
      speakers connected on NID 0x17, which the codec reports as unconnected.
      These speakers should be connected to the DAC on NID 0x03.
      
      Signed-off-by: default avatarPhilipp Jungkamp <p.jungkamp@gmx.net>
      Link: https://lore.kernel.org/r/20221205163713.7476-1-p.jungkamp@gmx.net
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      2912cdda
    • Vitaly Rodionov's avatar
      ALSA: hda/cirrus: Add extra 10 ms delay to allow PLL settle and lock. · 9fb9fa18
      Vitaly Rodionov authored
      
      
      New HW platforms with multiple CS42L42 parts, faster CPU and i2c
      requre some extra delay to allow PLL to settle and lock. Adding
      extra 10ms delay.
      
      Signed-off-by: default avatarVitaly Rodionov <vitalyr@opensource.cirrus.com>
      Link: https://lore.kernel.org/r/20221205145713.23852-1-vitalyr@opensource.cirrus.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      9fb9fa18
  6. Dec 05, 2022