]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: soc-core: verify Sound Card normality
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 3 Apr 2017 06:31:22 +0000 (06:31 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 5 Apr 2017 17:24:07 +0000 (18:24 +0100)
commit049b42c6b187ffc90b1147caf4df254be2530870
tree62a1d6f3b6ebc7fecab4fb59ebd7d16f0669d0f9
parent8cd2b40dad6f118d7287346f538ebda48662ad53
ASoC: soc-core: verify Sound Card normality

Current ALSA SoC Sound Card basically consists of CPU/Codec/Platform
components. If system uses Kernel modules, we can disable these drivers
by using rmmod command. In such case, we can't disable
CPU/Codec/Platform driver without disabling Sound Card driver.

But on the other hand, we can disable these drivers by using unbind
command. In such case, we can disable these drivers randomly.
In this case, we can create dirty Sound Card which is missing necessary
components.

(1) If user disabled Sound Card first, but did nothing to other drivers,
user can't use Sound because Sound Card is no longer exists.
(2) If user disabled CPU/Codec/Platform driver randomly, but did nothing
to Sound Card, user still be able to use Sound Card, because dirty Sound
Card still exists. In this case, Sound system will be crashed if user
started sound playback/capture. But we can't block such random unbind
now.

To avoid Sound Card crash in (2) case, we need to unregister Sound Card
whenever CPU/Codec/Platform component were unregistered.
This patch solves this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-core.c