All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ALSA: fix a user-triggerable WARN on repeated DSP load
@ 2026-10-29  8:48 YuanZhe Liu
  2026-10-29  8:48 ` [PATCH 1/2] ALSA: hwdep: Serialize DSP load requests YuanZhe Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: YuanZhe Liu @ 2026-10-29  8:48 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: Bin Yu, Cheng Wen, linux-sound, linux-kernel, stable

snd_hwdep_dsp_load() checks hw->dsp_loaded and then calls the driver's
dsp_load callback without any serialization.  A hwdep file descriptor can
be shared among threads, so two SNDRV_HWDEP_IOCTL_DSP_LOAD requests for
the same index can both pass the check and run the callback concurrently.

The snd-usb-usx2y driver then enters usx2y_async_seq04_init() twice, which
hits WARN_ON(usx2y->as04.buffer) and may also allocate the US-428
sequence URBs twice.

Patch 1 adds a per-device mutex around the check, the callback and the
bookkeeping.  Patch 2 removes the WARN_ON() assertions from the usx2y
initialization helpers: a repeated request after a partially failed load
is a valid sequence from user space, so the driver should return -EBUSY
instead of warning.

YuanZhe Liu (2):
  ALSA: hwdep: Serialize DSP load requests
  ALSA: usx2y: Avoid WARN on a repeated DSP load

 include/sound/hwdep.h      | 1 +
 sound/core/hwdep.c         | 2 ++
 sound/usb/usx2y/usbusx2y.c | 4 ++--
 3 files changed, 5 insertions(+), 2 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-10-31 19:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-29  8:48 [PATCH 0/2] ALSA: fix a user-triggerable WARN on repeated DSP load YuanZhe Liu
2026-10-29  8:48 ` [PATCH 1/2] ALSA: hwdep: Serialize DSP load requests YuanZhe Liu
2026-10-31 16:00   ` Takashi Iwai
2026-10-29  8:48 ` [PATCH 2/2] ALSA: usx2y: Avoid WARN on a repeated DSP load YuanZhe Liu
2026-10-31 16:00   ` Takashi Iwai
2026-10-31 17:16     ` [PATCH v2] ALSA: usx2y: Release the URBs when the DSP load fails YuanZhe Liu
2026-10-31 17:27       ` sashiko-bot
2026-10-31 18:56     ` [PATCH v3] " YuanZhe Liu
2026-10-31 19:07       ` sashiko-bot
2026-10-31 19:15     ` [PATCH v4] ALSA: usx2y: Refuse a retried DSP load after a failure YuanZhe Liu
2026-10-30 17:36 ` [PATCH 0/2] ALSA: fix a user-triggerable WARN on repeated DSP load YuanZhe Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.