]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: pcm: One more dependency for hw constraints
authorTakashi Iwai <tiwai@suse.de>
Sat, 23 Jan 2021 15:57:30 +0000 (16:57 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sat, 23 Jan 2021 15:59:24 +0000 (16:59 +0100)
commit7a2b3a8ab13d4566ca07378bd16b64dc30348ce8
tree63999a0395d92e7c3f2b7c54aab0070c6d49135a
parent82590ef7d8ab4049cde668e217d3d591351bb8df
ALSA: pcm: One more dependency for hw constraints

The fix for a long-standing USB-audio bug required one more dependency
variable to be added to the hw constraints.  Unfortunately I didn't
realize at debugging that the new addition may result in the overflow
of the dependency array of each snd_pcm_hw_rule (up to three plus a
sentinel), because USB-audio driver adds one more dependency only for
a certain device and bus, hence it works as is for many devices.  But
in a bad case, a simple open always results in -EINVAL (with kernel
WARNING if CONFIG_SND_DEBUG is set) no matter what is passed.

Since the dependencies are real and unavoidable (USB-audio restricts
the hw_params per looping over the format/rate/channels combos), the
only good solution seems to raise the bar for one more dependency for
snd_pcm_hw_rule -- so does this patch: now the hw constraint
dependencies can be up to four.

Fixes: 0cd97feef1fb ("ALSA: usb-audio: Fix hw constraints dependencies")
Reported-by: Jamie Heilman <jamie@audible.transient.net>
Link: https://lore.kernel.org/r/20210123155730.22576-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/pcm.h
sound/core/pcm_native.c