asoc: pcm-noirq: set substream state to disconnect when ssr happens

When SSR happens, set substream state to SNDRV_PCM_STATE_DISCONNECTED
to avoid userspace keeping waiting for substream state and causing
deadlock.

Change-Id: Iaa4d76101204652742c55d13da5c770c418a16bc
Signed-off-by: Meng Wang <mengw@codeaurora.org>
This commit is contained in:
Meng Wang 2020-11-03 11:02:29 +08:00
parent 78fff06931
commit e0705ab0d4

View File

@ -153,6 +153,8 @@ static const struct soc_enum msm_pcm_fe_topology_enum[] = {
static void event_handler(uint32_t opcode,
uint32_t token, uint32_t *payload, void *priv)
{
struct msm_audio *prtd = priv;
struct snd_pcm_substream *substream;
uint32_t *ptrmem = (uint32_t *)payload;
switch (opcode) {
@ -171,6 +173,18 @@ static void event_handler(uint32_t opcode,
break;
}
break;
case RESET_EVENTS:
if (!prtd || !prtd->substream) {
pr_err("%s: prtd or substream is NULL\n", __func__);
return;
}
substream = prtd->substream;
if (!substream->runtime || !substream->runtime->status) {
pr_err("%s: runtime or runtime->status is NULL\n", __func__);
return;
}
substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED;
break;
default:
pr_debug("Not Supported Event opcode[0x%x]\n", opcode);
break;