From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 942B23EDE62; Tue, 12 May 2026 17:56:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778608608; cv=none; b=eTyExxjlz3q7RS0H0k4ES3+keDNg+PO1kOwddRL9IX+nDQXeRd2PjQX9fI3Zt9RylP/XMmDDsUMO5KYvcrOXkvUHSPmB5JBrg4j7S9Ctenq7kQOzO3rRvLC9wvahmzwm2Twulp9MKswOQfZhDabQRvo8Gl+PG2CDB/ywfozS+BY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778608608; c=relaxed/simple; bh=wtA+Ah5VEE6IMgqsJoxXXOmwHFUqeIXhVGfgNc1o5tQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iLiKG4qPHmt8B76JD2qZkSZPxlJi9MSptXtiXa+IbYPjgtBps4cPB+5ygpji9j84vkIJrl3LDt6TVYD0rURAWv4oMlXBEONCUf+M4CjZ1nZed++gIbjjO4lod2PcAKGvCHwk7f9OAzEuy9FoP6mUyOcSRRPrNN9m1m3d9qXWPMg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vt+UTbSB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="vt+UTbSB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4A82C2BCB0; Tue, 12 May 2026 17:56:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778608608; bh=wtA+Ah5VEE6IMgqsJoxXXOmwHFUqeIXhVGfgNc1o5tQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vt+UTbSByuTKy/NX0eMSz8ig3l/WsObBNNntOGnCsJdioxAozcinjSMG+CzNPHAGq KbnGeGfnkIgWkm2M2brZ6yl8p2Mw+8IIeOj8e8Gq0N0BjrM8SvUbn8/Hk9FH3B8Upg hD+mdks2Y/KkQubrCkQx//ffUyXNJdjblhc0G8xA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Stable@vger.kernel.org, Srinivas Kandagatla , Mark Brown Subject: [PATCH 6.18 145/270] ASoC: qcom: q6apm-dai: reset queue ptr on trigger stop Date: Tue, 12 May 2026 19:39:06 +0200 Message-ID: <20260512173941.502324551@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260512173938.452574370@linuxfoundation.org> References: <20260512173938.452574370@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Srinivas Kandagatla commit cab45ab95ce7600fc0ff84585c77fd45b7b0d67c upstream. Reset queue pointer on SNDRV_PCM_TRIGGER_STOP event to be inline with resetting appl_ptr. Without this we will end up with a queue_ptr out of sync and driver could try to send data that is not ready yet. Fix this by resetting the queue_ptr. Fixes: 3d4a4411aa8bb ("ASoC: q6apm-dai: schedule all available frames to avoid dsp under-runs") Cc: Stable@vger.kernel.org Signed-off-by: Srinivas Kandagatla Link: https://patch.msgid.link/20260402081118.348071-6-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/qcom/qdsp6/q6apm-dai.c | 1 + sound/soc/qcom/qdsp6/q6apm.c | 2 ++ 2 files changed, 3 insertions(+) --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -323,6 +323,7 @@ static int q6apm_dai_trigger(struct snd_ case SNDRV_PCM_TRIGGER_STOP: /* TODO support be handled via SoftPause Module */ prtd->state = Q6APM_STREAM_STOPPED; + prtd->queue_ptr = 0; break; case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -225,6 +225,8 @@ int q6apm_map_memory_regions(struct q6ap mutex_lock(&graph->lock); + data->dsp_buf = 0; + if (data->buf) { mutex_unlock(&graph->lock); return 0;