Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: Intel: avs: DSP recovery and resume fixes

Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

Two fixes that are result of the recent discussions [1][2].

First adds missing locking around snd_pcm_stop() while the second fix
sets substream state to DISCONNECTED if any suspend/resume related
operation fails so that userspace has means to be aware that something
went wrong during said operation.

+11 -2
+3
sound/soc/intel/avs/ipc.c
··· 123 123 if (!substream || !substream->runtime) 124 124 continue; 125 125 126 + /* No need for _irq() as we are in nonatomic context. */ 127 + snd_pcm_stream_lock(substream); 126 128 snd_pcm_stop(substream, SNDRV_PCM_STATE_DISCONNECTED); 129 + snd_pcm_stream_unlock(substream); 127 130 } 128 131 } 129 132 }
+8 -2
sound/soc/intel/avs/pcm.c
··· 934 934 rtd = snd_pcm_substream_chip(data->substream); 935 935 if (rtd->dai_link->no_pcm == be && !rtd->dai_link->ignore_suspend) { 936 936 ret = op(dai, data); 937 - if (ret < 0) 937 + if (ret < 0) { 938 + __snd_pcm_set_state(data->substream->runtime, 939 + SNDRV_PCM_STATE_DISCONNECTED); 938 940 return ret; 941 + } 939 942 } 940 943 } 941 944 ··· 947 944 rtd = snd_pcm_substream_chip(data->substream); 948 945 if (rtd->dai_link->no_pcm == be && !rtd->dai_link->ignore_suspend) { 949 946 ret = op(dai, data); 950 - if (ret < 0) 947 + if (ret < 0) { 948 + __snd_pcm_set_state(data->substream->runtime, 949 + SNDRV_PCM_STATE_DISCONNECTED); 951 950 return ret; 951 + } 952 952 } 953 953 } 954 954 }