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 8F59520ED; Sat, 12 Sep 2026 08:51:28 +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=1789203089; cv=none; b=daz7gkgM5NKu1ifKgFwGPLBXlNj7OC4W3YOczaDro1RnbSUBSHGpMgJfD/uRgxbiCLUY7DmLwwODykhXC1ruPzXKHRIzvyMunWgsoJbSCUYxMmSiSbCUftF6eQCyK7JsSpPL3JwQZXf6KioCuOTNFIbO9Nyz5aruv9OdXCe0VMY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789203089; c=relaxed/simple; bh=85BLIth8j6HF0RxMHVxlanbFdzJ3vGqc0LsBBwh1gXE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=plmeTTOfJWFHB5KU6C1kKTXqArj4OHc5LhCGLtXU+qV2hdySEZjuf3NNcPjJNHnArNWv3lOyJaduXnoSlqOk7QksTq5f+ueoxm6LXxj1LTDMN/WsWFDB/dq6cL6kHeuu66ETYS0rKAYSoTAMKnpGV5jeLFQGC/eLkmlKb8HlS6g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SsWqSApd; 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="SsWqSApd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25BF01F00893; Sat, 12 Sep 2026 08:51:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789203088; bh=fMeK6N1kiGAX40+4Zi3nVdONBKgkRGstHZ1f9u3fSqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SsWqSApdmuxT5AF841Qr8mUhDnnoShYWQCpJLcMWd14RixUDJLglk7c1Qy8xYvCQd GHaMam6RsSV937itR5EyetzgT7dsHwJ/FkxhHJXSoEjk0gC+Ybxx47YTEOHDuVZJAr ApKWxalGOCH/TOCQwhGFz6+sO2W9KVuFOmoG/Szw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jorijn van der Graaf , Mark Brown , Sasha Levin Subject: [PATCH 7.2 1338/1815] ASoC: qcom: q6apm: keep the graph start count in sync with the DSP Date: Sat, 12 Sep 2026 08:51:28 +0200 Message-ID: <20260912065720.432595664@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065648.999753832@linuxfoundation.org> References: <20260912065648.999753832@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 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jorijn van der Graaf [ Upstream commit daa7ffd765ae67a83e77dae32c66ce2d6d995d19 ] q6apm_graph_start() increments start_count even when APM_CMD_GRAPH_START fails, leaving the graph counted as running while the DSP never started it. A later start - a retried prepare, or a resume after a failed start - then finds a non-zero count, skips the command and returns success with no data flowing. Count the graph only once the DSP has accepted the start. The count then stays at zero for a graph that never started, so also stop decrementing below zero in q6apm_graph_stop(): the compressed free path stops unconditionally, and a negative count would make the next start skip the command in the same way. Fixes: 5477518b8a0e ("ASoC: qdsp6: audioreach: add q6apm support") Assisted-by: Claude:claude-opus-5 Signed-off-by: Jorijn van der Graaf Link: https://patch.msgid.link/20260726211226.94059-1-jorijnvdgraaf@catcrafts.net Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/qcom/qdsp6/q6apm.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index 641d6d2432299..f167b9dae3fa1 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -802,14 +802,17 @@ EXPORT_SYMBOL_GPL(q6apm_graph_prepare); int q6apm_graph_start(struct q6apm_graph *graph) { struct audioreach_graph *ar_graph = graph->ar_graph; - int ret = 0; + int ret; - if (ar_graph->start_count == 0) + if (ar_graph->start_count == 0) { ret = audioreach_graph_mgmt_cmd(ar_graph, APM_CMD_GRAPH_START); + if (ret) + return ret; + } ar_graph->start_count++; - return ret; + return 0; } EXPORT_SYMBOL_GPL(q6apm_graph_start); @@ -817,6 +820,9 @@ int q6apm_graph_stop(struct q6apm_graph *graph) { struct audioreach_graph *ar_graph = graph->ar_graph; + if (ar_graph->start_count == 0) + return 0; + if (--ar_graph->start_count > 0) return 0; -- 2.53.0