From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796387891; b=vOTVVpQpsHDOMDLu7Bxouv6w6OwZTlVobh4cEdB6CZ/IOfXVQVEVNiyOMsJ4CXIzODMP TElchQGTAq1dQ68cOIKhzueapoycX3zuMfbcP4gU3bwRTtFZm3jiQe/yttWWgnCbjb/hJ oAECvTn3ttyNaAygPihfkHb72FiRmmo1WyrtE45Q7XdNXoeqUJJx1+l14Wt2rC3TxS7HI eyF16BnNIDEQQdI1sPT6OwuTKCPAfgU5nj9uAjOFz9xUDu/ePXyUGNxgdwvRi/WgnVNNR aOxG+fYL9MOTHbz9TqTuNxUpd59x38mear/2BhAqwjQfJ4WV54JnS8YhnvWX5eAu/4A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387891; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=XKzy5NAVfKAZsgwtYIVBquIPoTPVIulDzzxHK7OFWuE=; b=Wn06zSBFoIZLzh6vA5Oixa5YtJWQ224weWedIbk/VOPq043HS97UgJk0t9dF9mie7YEe Xe+0ssPOm0+ZaDwHsE5mkuGe9lC5pyzDzP4ptwLo7js3ve3G8VwHnG5SvMMbPrWxxQ276 BvKtavC+wpQh5xjnPx1jzFGWA9Q3y7bZBROKzKIFL5ogPCBPAgNqKUYTCXfY8LmCTppeZ XW0d/QjTliHFBBSpWarUiNIW2wEn7BqsV5bapKp3TcIGkrnzABwYOslhs+WDU26TTQMPK C+0EtFHaQ1ESCB2GxNevO6JyGYIoJiVVmqjV5MbHHRMOEqIk6RTPiUDHJQ0Mr6bojpA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=z6K9MeGC; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB568606A322; Fri, 4 Dec 2026 12:38:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=z6K9MeGC Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42A901F000CE; Fri, 4 Dec 2026 12:38:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387891; bh=XKzy5NAVfKAZsgwtYIVBquIPoTPVIulDzzxHK7OFWuE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=z6K9MeGC+W+fAgdcYTzZBDzQNrjLuCuHPhKR3rs5va6cGr2/MbrryYgHF96KUwj2h dqYOpL/ckbDfKUio1iEVngxb3bsJFZy7ktaOE4Ssu7Ur1VW0bHDoovkSqqOmEw+FSR WdoiSQQRj/8ZuKbm19qmzmcNk5b7q+YOIGl6S160= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Cezary Rojewski , Mark Brown , Sasha Levin Subject: [PATCH 6.1 0400/1059] ASoC: Intel: avs: Unprepare a stream when recovery occurs Date: Fri, 4 Dec 2026 18:58:51 +0900 Message-ID: <20261204100654.692862337@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Cezary Rojewski [ Upstream commit 85bc213f96ac03d74a3e531968c68861e5598281 ] Recovery on alsa-lib side is handled with either: 1) snd_pcm_prepare(state=XRUN) 2) snd_pcm_drop/drain() -> snd_pcm_prepare(state=SETUP) before starting the PCM anew. Relying solely on state=XRUN leaves 2) unaccounted for. sound/core/pcm_native.c ensures correctness of the state machine so plain state!=PREPARED check suffices. This is the BE equivalent of job done previously for FE side only with commit cfca1637bc2b ("ASoC: Intel: avs: Unprepare a stream when XRUN occurs") and its follow up titled: ("ASoC: Intel: avs: Reset the stream unless it is already prepared"). Link: https://lore.kernel.org/linux-sound/20261010103753.16969-1-stiraspo@gmail.com/T/ Fixes: d070002a20fc ("ASoC: Intel: avs: HDA PCM BE operations") Signed-off-by: Cezary Rojewski Link: https://patch.msgid.link/20261015190240.729793-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown [ sashal: Inserted the two-line link_prepared reset at the equivalent spot, since this tree's function reads link_stream from runtime->private_data and lacks the upstream context lines. ] Signed-off-by: Sasha Levin --- sound/soc/intel/avs/pcm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c index b6730cbd12224..91446a458d0c3 100644 --- a/sound/soc/intel/avs/pcm.c +++ b/sound/soc/intel/avs/pcm.c @@ -313,6 +313,8 @@ static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct sn unsigned int format_val; int ret; + if (substream->runtime->state != SNDRV_PCM_STATE_PREPARED) + link_stream->link_prepared = false; if (link_stream->link_prepared) return 0; -- 2.53.0