ASoC: dai playback and capture active may be greater than 1
authorJerome Brunet <>
Fri, 27 Apr 2018 11:31:51 +0000 (13:31 +0200)
committerMark Brown <>
Tue, 1 May 2018 20:56:36 +0000 (05:56 +0900)
At the moment playback_active and capture_active are using only 1 bit so
the maximum active count is 1.

However, snd_soc_runtime_activate() may be called several time on the
same dai. This happens when a dai is part of several dai_links. It is
often the case for "snd-soc-dummy-dai".

This is a problem if snd_soc_runtime_activate() is called an even number
of times on a dai. In this case the active count overflow back to 0. As
consequence, ASoC functions, such as soc_dpcm_runtime_update(), won't run

Storing these usage counts on plain 'unsigned int' solves the problem.

Fixes: f0fba2ad1b6b ("ASoC: multi-component - ASoC Multi-Component Support")
Signed-off-by: Jerome Brunet <>
Signed-off-by: Mark Brown <>

index 8ad11669e4d8f346ae3e654587386af88d08281e..35ebb0be51145906b3b493bb1dc8d41601a3ba06 100644 (file)
@@ -294,8 +294,8 @@ struct snd_soc_dai {
        struct snd_soc_dai_driver *driver;
        /* DAI runtime info */
-       unsigned int capture_active:1;          /* stream is in use */
-       unsigned int playback_active:1;         /* stream is in use */
+       unsigned int capture_active;            /* stream usage count */
+       unsigned int playback_active;           /* stream usage count */
        unsigned int probed:1;
        unsigned int active;