Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8843c613 authored by Xiaoyu Ye's avatar Xiaoyu Ye
Browse files

asoc: msm-lsm-client: abort LAB buffering before stop session and close TX



Currently we only set read_abort flag to stop LAB buffering before we call
q6lsm_stop_lab. There is a possibility that this step is skipped under
certain circumstances. This might cause ADSP crash as a result. Therefore,
set flag read_abort before calling q6lsm_stop and q6lsm_close to make sure
LAB buffering is stopped before closing a SVA session.

Change-Id: I7364c31348f908d8920e32f811745549cf305901
Signed-off-by: default avatarXiaoyu Ye <benyxy@codeaurora.org>
parent 02c598e2
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -1457,6 +1457,12 @@ static int msm_lsm_ioctl_shared(struct snd_pcm_substream *substream,
					prtd->lsm_client->lab_started = false;
				}
			}

			if (!atomic_read(&prtd->read_abort)) {
				dev_dbg(rtd->dev,
					"%s: set read_abort to stop buffering\n", __func__);
				atomic_set(&prtd->read_abort, 1);
			}
			rc = q6lsm_stop(prtd->lsm_client, true);
			if (!rc)
				dev_dbg(rtd->dev,
@@ -2660,6 +2666,12 @@ static int msm_lsm_close(struct snd_pcm_substream *substream)
						__func__, ret);
			}
		}

		if (!atomic_read(&prtd->read_abort)) {
			dev_dbg(rtd->dev,
				"%s: set read_abort to stop buffering\n", __func__);
			atomic_set(&prtd->read_abort, 1);
		}
		ret = q6lsm_stop(prtd->lsm_client, true);
		if (ret)
			dev_err(rtd->dev,
@@ -2690,6 +2702,11 @@ static int msm_lsm_close(struct snd_pcm_substream *substream)
					SNDRV_PCM_STREAM_CAPTURE);

	if (prtd->lsm_client->opened) {
		if (!atomic_read(&prtd->read_abort)) {
			dev_dbg(rtd->dev,
				"%s: set read_abort to stop buffering\n", __func__);
			atomic_set(&prtd->read_abort, 1);
		}
		q6lsm_close(prtd->lsm_client);
		prtd->lsm_client->opened = false;
	}