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 93BE52E06E4; Tue, 25 Aug 2026 13:51:14 +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=1787665875; cv=none; b=PPwSRibuulyGlF4P7IJH33KUxgDNyIovhy/zN9HdgA1wVMK1x+PVL5LR4B+3xr+a7bn/lLYi5IcqGzrIEiilTdUFx+kCulVNufseKiEhMC5D5gEeeLFDd9mpuaajhkXA9PfrnLUUCGlR4szYIsN366uq3y7ekzWeWj6pbqJDXJw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787665875; c=relaxed/simple; bh=wX2dbN3Y/gtQbIotsFSlOddmXi5vqnThQUEcxpB795Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F4qhoZLN0ey2PWyHCPlbCek0oSzjtuVJuaLYvL3cGd9fuICtyCZ+voFgYyWP+cAoEFmcGX8dQM44+sWv5k5c9di59106/kDpFpJsPNpDc+i+a2Sdi4+ue4Ee6zPMsoAYeHgYlgXR+1gPr+5z8FHy4E8LD9k/Yi47n7tAmVUr9bc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XL/l86Bc; 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="XL/l86Bc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D422C1F000E9; Tue, 25 Aug 2026 13:51:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787665874; bh=rkystHqY743Rf5+GORz/WRBIfJNucy2K7GUqE8taCN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XL/l86BcpvwQwo2mhNWESqQqRQujHi8FofSHJ473iy3QIBVazi3h+gwwqhGR1ljDc Nnb0Un7URZ7kXDY7oyZKuOKnabTIriDzLI8yl+eYGBh9MxQHQXNhLdu9f8e7kY+m9z 2HzoA1E73Xw8UCmco+QWXeuaxiYCALwAlE3yFShw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Peter Ujfalusi , Kai Vehmanen , Mark Brown , Sasha Levin Subject: [PATCH 6.6 61/87] ASoC: SOF: ipc4-pcm: Continue the pipeline trigger in case of IPC timeout Date: Tue, 25 Aug 2026 15:26:24 +0200 Message-ID: <20260825132544.221359212@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260825132541.813800447@linuxfoundation.org> References: <20260825132541.813800447@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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peter Ujfalusi [ Upstream commit 17661c67b206612cb3ba65d5ae726cd2015d0a53 ] Ignore IPC errors for pipeline state change if the firmware state is crashed or the IPC has timed out. If the firmware has crashed the kernel still needs to go through the state changes to reset its internal to be able to correctly work the next time the DSP is booted up. The case with IPC timeout is a bit more problematic, but it has been rootcaused to be the result of system scheduling blockage and the firmware did actually received and handled the message, but the reply handling got blocked by issues outside of the SOF stack. So far the best way to handle this is to continue with setting the state. Fixes: c40aad7c81e5 ("ASoC: SOF: ipc4-pcm: Workaround for crashed firmware on system suspend") Cc: stable@vger.kernel.org Signed-off-by: Peter Ujfalusi Reviewed-by: Kai Vehmanen Link: https://patch.msgid.link/20260730112343.26687-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- sound/soc/sof/ipc4-pcm.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) --- a/sound/soc/sof/ipc4-pcm.c +++ b/sound/soc/sof/ipc4-pcm.c @@ -359,7 +359,19 @@ static int sof_ipc4_trigger_pipelines(st ret = sof_ipc4_set_multi_pipeline_state(sdev, SOF_IPC4_PIPE_PAUSED, trigger_list); if (ret < 0) { spcm_err(spcm, substream->stream, "failed to pause all pipelines\n"); - goto free; + /* + * workaround: if the firmware is crashed or the IPC timed out + * while setting the pipeline state we must ignore the error + * code and proceed to set adjust the local pipeline states. + * + * If the firmware is crashed we will not send IPC messages + * and we are going to see errors printed, but the state of the + * widgets will be correct for the next boot. + */ + if (sdev->fw_state != SOF_FW_CRASHED && ret != -ETIMEDOUT) + goto free; + + ret = 0; } /* update PAUSED state for all pipelines just triggered */ @@ -380,14 +392,15 @@ skip_pause_transition: "failed to set final state %d for all pipelines\n", state); /* - * workaround: if the firmware is crashed while setting the - * pipelines to reset state we must ignore the error code and - * reset it to 0. - * Since the firmware is crashed we will not send IPC messages + * workaround: if the firmware is crashed or the IPC timed out + * while setting the pipeline state we must ignore the error + * code and proceed to set adjust the local pipeline states. + * + * If the firmware is crashed we will not send IPC messages * and we are going to see errors printed, but the state of the * widgets will be correct for the next boot. */ - if (sdev->fw_state != SOF_FW_CRASHED || state != SOF_IPC4_PIPE_RESET) + if (sdev->fw_state != SOF_FW_CRASHED && ret != -ETIMEDOUT) goto free; ret = 0;