diff options
author | Peter Ujfalusi <peter.ujfalusi@linux.intel.com> | 2021-07-26 21:21:42 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-07-27 15:13:04 +0300 |
commit | 2635c226036c1bf44b86575d0bc721505c8201e3 (patch) | |
tree | f359270b9d59421592217572562a407b37e7c922 /sound/soc/Kconfig | |
parent | 0f32d9eb38c13c32895b5bf695eac639cee02d6c (diff) | |
download | linux-2635c226036c1bf44b86575d0bc721505c8201e3.tar.xz |
ASoC: topology: Select SND_DYNAMIC_MINORS
The indexes of the devices are described within the topology file, it is a
possibility that the topology encodes invalid indexes when DYNAMIC_MINORS
is not enabled in kernel:
#define SNDRV_MINOR_COMPRESS 2 /* 2 - 3 */
#define SNDRV_MINOR_HWDEP 4 /* 4 - 7 */
#define SNDRV_MINOR_RAWMIDI 8 /* 8 - 15 */
#define SNDRV_MINOR_PCM_PLAYBACK 16 /* 16 - 23 */
#define SNDRV_MINOR_PCM_CAPTURE 24 /* 24 - 31 */
If the topology assigns an index greater than 7 for PLAYBACK/CAPTURE PCM
then there will be minor number collision.
As an example:
card0 creates a capture PCM with index 10 -> minor = 34
card1 creates compress device with index 0 -> minor = 34
Card1 will fail to instantiate because the minor for the compress stream is
already taken.
To avoid seemingly mysterious issues with card creation, select the
DYNAMIC_MINORS when the topology is enabled.
The other option would be to try to do out of bound index checks in case of
DYNAMIC_MINOR is not enabled and do not even attempt to create the device
with failing the topology load.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210726182142.179604-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/Kconfig')
-rw-r--r-- | sound/soc/Kconfig | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig index 8a13462e1a63..5dcf77af07af 100644 --- a/sound/soc/Kconfig +++ b/sound/soc/Kconfig @@ -36,6 +36,7 @@ config SND_SOC_COMPRESS config SND_SOC_TOPOLOGY bool + select SND_DYNAMIC_MINORS config SND_SOC_TOPOLOGY_KUNIT_TEST tristate "KUnit tests for SoC topology" |