Skip to content

Commit 91b98d5

Browse files
cristiccbroonie
authored andcommitted
ASoC: SOF: amd: Add post_fw_run_delay ACP quirk
Stress testing resume from suspend on Valve Steam Deck OLED (Galileo) revealed that the DSP firmware could enter an unrecoverable faulty state, where the kernel ring buffer is flooded with IPC related error messages: [ +0.017002] snd_sof_amd_vangogh 0000:04:00.5: acp_sof_ipc_send_msg: Failed to acquire HW lock [ +0.000054] snd_sof_amd_vangogh 0000:04:00.5: ipc3_tx_msg_unlocked: ipc message send for 0x30100000 failed: -22 [ +0.000005] snd_sof_amd_vangogh 0000:04:00.5: Failed to setup widget PIPELINE.6.ACPHS1.IN [ +0.000004] snd_sof_amd_vangogh 0000:04:00.5: Failed to restore pipeline after resume -22 [ +0.000003] snd_sof_amd_vangogh 0000:04:00.5: PM: dpm_run_callback(): pci_pm_resume returns -22 [ +0.000009] snd_sof_amd_vangogh 0000:04:00.5: PM: failed to resume async: error -22 [...] [ +0.002582] PM: suspend exit [ +0.065085] snd_sof_amd_vangogh 0000:04:00.5: ipc tx error for 0x30130000 (msg/reply size: 12/0): -22 [ +0.000499] snd_sof_amd_vangogh 0000:04:00.5: error: failed widget list set up for pcm 1 dir 0 [ +0.000011] snd_sof_amd_vangogh 0000:04:00.5: error: set pcm hw_params after resume [ +0.000006] snd_sof_amd_vangogh 0000:04:00.5: ASoC: error at snd_soc_pcm_component_prepare on 0000:04:00.5: -22 [...] A system reboot would be necessary to restore the speakers functionality. However, by delaying a bit any host to DSP transmission right after the firmware boot completed, the issue could not be reproduced anymore and sound continued to work flawlessly even after performing thousands of suspend/resume cycles. Introduce the post_fw_run_delay ACP quirk to allow providing the aforementioned delay via the snd_sof_dsp_ops->post_fw_run() callback for the affected devices. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Link: https://patch.msgid.link/20250207-sof-vangogh-fixes-v1-1-67824c1e4c9a@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 7858def commit 91b98d5

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

sound/soc/sof/amd/acp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ MODULE_PARM_DESC(enable_fw_debug, "Enable Firmware debug");
2727
static struct acp_quirk_entry quirk_valve_galileo = {
2828
.signed_fw_image = true,
2929
.skip_iram_dram_size_mod = true,
30+
.post_fw_run_delay = true,
3031
};
3132

3233
const struct dmi_system_id acp_sof_quirk_table[] = {

sound/soc/sof/amd/acp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ struct sof_amd_acp_desc {
220220
struct acp_quirk_entry {
221221
bool signed_fw_image;
222222
bool skip_iram_dram_size_mod;
223+
bool post_fw_run_delay;
223224
};
224225

225226
/* Common device data struct for ACP devices */

sound/soc/sof/amd/vangogh.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* Hardware interface for Audio DSP on Vangogh platform
1212
*/
1313

14+
#include <linux/delay.h>
1415
#include <linux/platform_device.h>
1516
#include <linux/module.h>
1617

@@ -136,6 +137,20 @@ static struct snd_soc_dai_driver vangogh_sof_dai[] = {
136137
},
137138
};
138139

140+
static int sof_vangogh_post_fw_run_delay(struct snd_sof_dev *sdev)
141+
{
142+
/*
143+
* Resuming from suspend in some cases my cause the DSP firmware
144+
* to enter an unrecoverable faulty state. Delaying a bit any host
145+
* to DSP transmission right after firmware boot completion seems
146+
* to resolve the issue.
147+
*/
148+
if (!sdev->first_boot)
149+
usleep_range(100, 150);
150+
151+
return 0;
152+
}
153+
139154
/* Vangogh ops */
140155
struct snd_sof_dsp_ops sof_vangogh_ops;
141156
EXPORT_SYMBOL_NS(sof_vangogh_ops, "SND_SOC_SOF_AMD_COMMON");
@@ -157,6 +172,9 @@ int sof_vangogh_ops_init(struct snd_sof_dev *sdev)
157172

158173
if (quirks->signed_fw_image)
159174
sof_vangogh_ops.load_firmware = acp_sof_load_signed_firmware;
175+
176+
if (quirks->post_fw_run_delay)
177+
sof_vangogh_ops.post_fw_run = sof_vangogh_post_fw_run_delay;
160178
}
161179

162180
return 0;

0 commit comments

Comments
 (0)