From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 F24553195FD; Sun, 7 Jun 2026 10:42:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780828971; cv=none; b=Ya8XEt07hFaI4dTAz+Khr8nqfqGr/WwUE/wIra3ZDwcpkIrLbir2/4/CO0lssywfQeUEaWmePukVq6iyM0u/GmK5yCadMNb76RHshj/EXXs2LmEgo39ORtCXXYRV9R8LV/CHlUh2DLiH+CiBDD+cY4ZKIJOXqoFKTuVcLFJvh+U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780828971; c=relaxed/simple; bh=s5pgZmUl/8Q8BjIr1FFSM9NEvSjfDTMQzlPO0ZzMOjs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qFC5OciSH26DMzi5ybeD3c/MgMUzGKSUxXTlpfRMgoBN0gq4I8psDr8SK17xPMJWUjYPcHeN2Uv+Av6KNbpY3auxoTUl2VhzikzghJCGJe8jhpPjnRz5pngJoOyDjEUaK+8YBoEUAqw6b0tuJxNMQ8F8fwCJ9jGK2R2gzQ/ZLhc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=simg8mqi; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="simg8mqi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EED4D1F00893; Sun, 7 Jun 2026 10:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780828970; bh=uWEBb6tg2v2VWLBn5GyO3V3G8N8OsY8czownzMBdPe8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=simg8mqiIHQLuZ44iGFl7h6Bh31pJIQXmNvd1ikaG12B6oFzEADLoWeaxwtHBPVGH J0Hrk2aXGBFBFGs630Zm261fLwO5fVRMA4RlPhSpumb+PnmMpPqzAq9gDkdm6FBlil +EYivoBd2fEWf5/cz5vNYxiKBwPHL3KecF08O/7c= 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 206/315] ASoC: qcom: q6asm-dai: close stream only when running Date: Sun, 7 Jun 2026 11:59:53 +0200 Message-ID: <20260607095735.127106486@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260607095727.528828913@linuxfoundation.org> References: <20260607095727.528828913@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev 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 048c540ee76ded666bda74f9dae1ca3254e0633c upstream. q6asm_dai_close() and q6asm_dai_compr_free() currently issue CMD_CLOSE whenever prtd->state is non-zero. After prepare() closes an existing stream, the state is updated to Q6ASM_STREAM_STOPPED. Since this state is also non-zero, the close and free paths can send CMD_CLOSE again for a stream that has already been closed. Restrict CMD_CLOSE to the Q6ASM_STREAM_RUNNING state so the command is sent only when the ASM stream is still active. Fixes: 2a9e92d371db ("ASoC: qdsp6: q6asm: Add q6asm dai driver") Cc: Stable@vger.kernel.org Signed-off-by: Srinivas Kandagatla Link: https://patch.msgid.link/20260518092347.3446946-3-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/qcom/qdsp6/q6asm-dai.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -447,12 +447,12 @@ static int q6asm_dai_close(struct snd_so struct q6asm_dai_rtd *prtd = runtime->private_data; if (prtd->audio_client) { - if (prtd->state) + if (prtd->state == Q6ASM_STREAM_RUNNING) { q6asm_cmd(prtd->audio_client, prtd->stream_id, CMD_CLOSE); - - q6asm_unmap_memory_regions(substream->stream, + q6asm_unmap_memory_regions(substream->stream, prtd->audio_client); + } q6asm_audio_client_free(prtd->audio_client); prtd->audio_client = NULL; } @@ -669,7 +669,7 @@ static int q6asm_dai_compr_free(struct s struct snd_soc_pcm_runtime *rtd = stream->private_data; if (prtd->audio_client) { - if (prtd->state) { + if (prtd->state == Q6ASM_STREAM_RUNNING) { q6asm_cmd(prtd->audio_client, prtd->stream_id, CMD_CLOSE); if (prtd->next_track_stream_id) { @@ -677,11 +677,11 @@ static int q6asm_dai_compr_free(struct s prtd->next_track_stream_id, CMD_CLOSE); } - } - snd_dma_free_pages(&prtd->dma_buffer); - q6asm_unmap_memory_regions(stream->direction, + q6asm_unmap_memory_regions(stream->direction, prtd->audio_client); + } + snd_dma_free_pages(&prtd->dma_buffer); q6asm_audio_client_free(prtd->audio_client); prtd->audio_client = NULL; }