Skip to content
  1. Mar 24, 2023
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix regression on detection of Roland VS-100 · fa4e7a6f
      Takashi Iwai authored
      It's been reported that the recent kernel can't probe the PCM devices
      on Roland VS-100 properly, and it turned out to be a regression by the
      recent addition of the bit shift range check for the format bits.
      In the old code, we just did bit-shift and it resulted in zero, which
      is then corrected to the standard PCM format, while the new code
      explicitly returns an error in such a case.
      
      For addressing the regression, relax the check and fallback to the
      standard PCM type (with the info output).
      
      Fixes: 43d5ca88
      
       ("ALSA: usb-audio: Fix potential out-of-bounds shift")
      Cc: <stable@vger.kernel.org>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=217084
      Link: https://lore.kernel.org/r/20230324075005.19403-1-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      fa4e7a6f
  2. Mar 23, 2023
  3. Mar 21, 2023
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix recursive locking at XRUN during syncing · 8c721c53
      Takashi Iwai authored
      The recent support of low latency playback in USB-audio driver made
      the snd_usb_queue_pending_output_urbs() function to be called via PCM
      ack ops.  In the new code path, the function is performed already in
      the PCM stream lock.  The problem is that, when an XRUN is detected,
      the function calls snd_pcm_xrun() to notify, but snd_pcm_xrun() is
      supposed to be called only outside the stream lock.  As a result, it
      leads to a deadlock of PCM stream locking.
      
      For avoiding such a recursive locking, this patch adds an additional
      check to the code paths in PCM core that call the ack callback; now it
      checks the error code from the callback, and if it's -EPIPE, the XRUN
      is handled in the PCM core side gracefully.  Along with it, the
      USB-audio driver code is changed to follow that, i.e. -EPIPE is
      returned instead of the explicit snd_pcm_xrun() call when the function
      is performed already in the stream lock.
      
      Fixes: d5f871f8
      
       ("ALSA: usb-audio: Improved lowlatency playback support")
      Reported-and-tested-by: default avatarJohn Keeping <john@metanate.com>
      Link: https://lore.kernel.org/r/20230317195128.3911155-1-john@metanate.com
      Reviewed-by: default avatarJaroslav Kysela <perex@perex.cz>
      Reviewed-by; Takashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20230320142838.494-1-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      8c721c53
    • Takashi Iwai's avatar
      ALSA: hda/conexant: Partial revert of a quirk for Lenovo · b871cb97
      Takashi Iwai authored
      The recent commit f83bb259 ("ALSA: hda/conexant: Add quirk for
      LENOVO 20149 Notebook model") introduced a quirk for the device with
      17aa:3977, but this caused a regression on another model (Lenovo
      Ideadpad U31) with the very same PCI SSID.  And, through skimming over
      the net, it seems that this PCI SSID is used for multiple different
      models, so it's no good idea to apply the quirk with the SSID.
      
      Although we may take a different ID check (e.g. the codec SSID instead
      of the PCI SSID), unfortunately, the original patch author couldn't
      identify the hardware details any longer as the machine was returned,
      and we can't develop the further proper fix.
      
      In this patch, instead, we partially revert the change so that the
      quirk won't be applied as default for addressing the regression.
      Meanwhile, the quirk function itself is kept, and it's now made to be
      applicable via the explicit model=lenovo-20149 option.
      
      Fixes: f83bb259
      
       ("ALSA: hda/conexant: Add quirk for LENOVO 20149 Notebook model")
      Reported-by: default avatarJetro Jormalainen <jje-lxkl@jetro.fi>
      Link: https://lore.kernel.org/r/20230308215009.4d3e58a6@mopti
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20230320140954.31154-1-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      b871cb97
  4. Mar 19, 2023
  5. Mar 15, 2023
    • Kuninori Morimoto's avatar
      ALSA: hda/ca0132: fixup buffer overrun at tuning_ctl_set() · 98e5eb11
      Kuninori Morimoto authored
      
      
      tuning_ctl_set() might have buffer overrun at (X) if it didn't break
      from loop by matching (A).
      
      	static int tuning_ctl_set(...)
      	{
      		for (i = 0; i < TUNING_CTLS_COUNT; i++)
      (A)			if (nid == ca0132_tuning_ctls[i].nid)
      				break;
      
      		snd_hda_power_up(...);
      (X)		dspio_set_param(..., ca0132_tuning_ctls[i].mid, ...);
      		snd_hda_power_down(...);                ^
      
      		return 1;
      	}
      
      We will get below error by cppcheck
      
      	sound/pci/hda/patch_ca0132.c:4229:2: note: After for loop, i has value 12
      	 for (i = 0; i < TUNING_CTLS_COUNT; i++)
      	 ^
      	sound/pci/hda/patch_ca0132.c:4234:43: note: Array index out of bounds
      	 dspio_set_param(codec, ca0132_tuning_ctls[i].mid, 0x20,
      	                                           ^
      This patch cares non match case.
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87sfe9eap7.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      98e5eb11
    • Kuninori Morimoto's avatar
      ALSA: asihpi: check pao in control_message() · 9026c0bf
      Kuninori Morimoto authored
      
      
      control_message() might be called with pao = NULL.
      Here indicates control_message() as sample.
      
      (B)	static void control_message(struct hpi_adapter_obj *pao, ...)
      	{                                                   ^^^
      		struct hpi_hw_obj *phw = pao->priv;
      		...                      ^^^
      	}
      
      (A)	void _HPI_6205(struct hpi_adapter_obj *pao, ...)
      	{                                      ^^^
      		...
      		case HPI_OBJ_CONTROL:
      (B)			control_message(pao, phm, phr);
      			break;          ^^^
      		...
      	}
      
      	void HPI_6205(...)
      	{
      		...
      (A)		_HPI_6205(NULL, phm, phr);
      		...       ^^^^
      	}
      
      Therefore, We will get too many warning via cppcheck, like below
      
      	sound/pci/asihpi/hpi6205.c:238:27: warning: Possible null pointer dereference: pao [nullPointer]
      		 struct hpi_hw_obj *phw = pao->priv;
      		                          ^
      	sound/pci/asihpi/hpi6205.c:433:13: note: Calling function '_HPI_6205', 1st argument 'NULL' value is 0
      		  _HPI_6205(NULL, phm, phr);
      		            ^
      	sound/pci/asihpi/hpi6205.c:401:20: note: Calling function 'control_message', 1st argument 'pao' value is 0
      	   control_message(pao, phm, phr);
      	                   ^
      Set phr->error like many functions doing, and don't call _HPI_6205()
      with NULL.
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87ttypeaqz.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      9026c0bf
  6. Mar 10, 2023
    • Takashi Iwai's avatar
      Merge tag 'asoc-fix-v6.3-rc1' of... · c24ff3ec
      Takashi Iwai authored
      Merge tag 'asoc-fix-v6.3-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
      
      ASoC: Fixes for v6.3
      
      More fixes that came in since -rc1, a lot from Intel - looks like
      they've been busy test.  Everything is driver specific.
      c24ff3ec
  7. Mar 09, 2023
    • Emil Abildgaard Svendsen's avatar
      ASoC: hdmi-codec: only startup/shutdown on supported streams · e041a2a5
      Emil Abildgaard Svendsen authored
      
      
      Currently only one stream is supported. This isn't usally a problem
      until you have a multi codec audio card. Because the audio card will run
      startup and shutdown on both capture and playback streams. So if your
      hdmi-codec only support either playback or capture. Then ALSA can't open
      for playback and capture.
      
      This patch will ignore if startup and shutdown are called with a non
      supported stream. Thus, allowing an audio card like this:
      
                 +-+
       cpu1 <--@-| |-> codec1 (HDMI-CODEC)
                 | |<- codec2 (NOT HDMI-CODEC)
                 +-+
      
      Signed-off-by: default avatarEmil Svendsen <emas@bang-olufsen.dk>
      Link: https://lore.kernel.org/r/20230309065432.4150700-2-emas@bang-olufsen.dk
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      e041a2a5
  8. Mar 08, 2023
    • Guenter Roeck's avatar
      ASoC: da7219: Initialize jack_det_mutex · af0f46e5
      Guenter Roeck authored
      The following traceback is reported if mutex debugging is enabled.
      
      DEBUG_LOCKS_WARN_ON(lock->magic != lock)
      WARNING: CPU: 0 PID: 17 at kernel/locking/mutex.c:950 __mutex_lock_common+0x31c/0x11d4
      Modules linked in:
      CPU: 0 PID: 17 Comm: kworker/0:1 Not tainted 5.10.172-lockdep-21846-g849884cfca5a #1 fd2de466502012eb58bc8beb467f07d0b925611f
      Hardware name: MediaTek kakadu rev0/rev1 board (DT)
      Workqueue: events da7219_aad_jack_det_work
      pstate: 60400005 (nZCv daif +PAN -UAO -TCO BTYPE=--)
      pc : __mutex_lock_common+0x31c/0x11d4
      lr : __mutex_lock_common+0x31c/0x11d4
      sp : ffffff80c0317ae0
      x29: ffffff80c0317b50 x28: ffffff80c0317b20
      x27: 0000000000000000 x26: 0000000000000000
      x25: 0000000000000000 x24: 0000000100000000
      x23: ffffffd0121d296c x22: dfffffd000000000
      x21: 0000000000000000 x20: 0000000000000000
      x19: ffffff80c73d7190 x18: 1ffffff018050f52
      x17: 0000000000000000 x16: 0000000000000000
      x15: 0000000000000000 x14: 0000000000000000
      x13: 0000000000000001 x12: 0000000000000001
      x11: 0000000000000000 x10: 0000000000000000
      x9 : 83f0d991da544b00 x8 : 83f0d991da544b00
      x7 : 0000000000000000 x6 : 0000000000000001
      x5 : ffffff80c03176a0 x4 : 0000000000000000
      x3 : ffffffd01067fd78 x2 : 0000000100000000
      x1 : ffffff80c030ba80 x0 : 0000000000000028
      Call trace:
      __mutex_lock_common+0x31c/0x11d4
      mutex_lock_nested+0x98/0xac
      da7219_aad_jack_det_work+0x54/0xf0
      process_one_work+0x6cc/0x19dc
      worker_thread+0x458/0xddc
      kthread+0x2fc/0x370
      ret_from_fork+0x10/0x30
      irq event stamp: 579
      hardirqs last enabled at (579): [<ffffffd012442b30>] exit_to_kernel_mode+0x108/0x138
      hardirqs last disabled at (577): [<ffffffd010001144>] __do_softirq+0x53c/0x125c
      softirqs last enabled at (578): [<ffffffd01009995c>] __irq_exit_rcu+0x264/0x4f4
      softirqs last disabled at (573): [<ffffffd01009995c>] __irq_exit_rcu+0x264/0x4f4
      ---[ end trace 26da674636181c40 ]---
      
      Initialize the mutex to fix the problem.
      
      Cc: David Rau <David.Rau.opensource@dm.renesas.com>
      Fixes: 7fde88ed
      
       ("ASoC: da7219: Improve the IRQ process to increase the stability")
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Link: https://lore.kernel.org/r/20230307155111.1985522-1-linux@roeck-us.net
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      af0f46e5
    • Bjorn Helgaas's avatar
      ALSA: hda: Match only Intel devices with CONTROLLER_IN_GPU() · ff447886
      Bjorn Helgaas authored
      CONTROLLER_IN_GPU() is clearly intended to match only Intel devices, but
      previously it checked only the PCI Device ID, not the Vendor ID, so it
      could match devices from other vendors that happened to use the same Device
      ID.
      
      Update CONTROLLER_IN_GPU() so it matches only Intel devices.
      
      Fixes: 535115b5
      
       ("ALSA: hda - Abort the probe without i915 binding for HSW/B")
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Link: https://lore.kernel.org/r/20230307214054.886721-1-helgaas@kernel.org
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      ff447886
    • Hamidreza H. Fard's avatar
      ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book2 Pro · a86e79e3
      Hamidreza H. Fard authored
      
      
      Samsung Galaxy Book2 Pro (13" 2022 NP930XED-KA1DE) with codec SSID
      144d:c868 requires the same workaround for enabling the speaker amp
      like other Samsung models with ALC298 code.
      
      Signed-off-by: default avatarHamidreza H. Fard <nitocris@posteo.net>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20230307163741.3878-1-nitocris@posteo.net
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      a86e79e3
    • Jeremy Szu's avatar
      ALSA: hda/realtek: fix speaker, mute/micmute LEDs not work on a HP platform · 7bb62340
      Jeremy Szu authored
      
      
      There is a HP platform needs ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED quirk to
      make mic-mute/audio-mute/speaker working.
      
      Signed-off-by: default avatarJeremy Szu <jeremy.szu@canonical.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20230307135317.37621-1-jeremy.szu@canonical.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7bb62340
    • Bard Liao's avatar
      ALSA: hda: intel-dsp-config: add MTL PCI id · bbdf904b
      Bard Liao authored
      
      
      Use SOF as default audio driver.
      
      Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
      Reviewed-by: default avatarGongjun Song <gongjun.song@intel.com>
      Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20230306074101.3906707-1-yung-chuan.liao@linux.intel.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      bbdf904b
    • Mark Brown's avatar
      SoC: SOF: Intel: FIx device descriptions (missing · a7ee5b42
      Mark Brown authored
      Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:
      
      We have recently noticed that the ops_free callback was missed for the device
      descriptions on Intel platforms.
      a7ee5b42
  9. Mar 07, 2023
  10. Mar 06, 2023