From: sashiko-bot@kernel.org
To: sravisar@amd.com
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH 2/2] ASoC: SOF: amd: acp7x: reload firmware from disk on S4 resume
Date: Wed, 25 Nov 2026 06:02:04 +0000 [thread overview]
Message-ID: <sashiko-outbox-232637@kernel.org> (raw)
In-Reply-To: <20261125053843.1611378-3-sravisar@amd.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] ASoC: SOF: amd: S4 carveout reset bypassed in
amd_sof_acp7x_resume()
- [Medium] ASoC: SOF: amd: missed carveout clear in
amd_sof_acp7x_resume() after FW crash
--
commit b8704d96ab1f4418fdf040e05ffe9e060f0a776b
Author: Siva Subramanian Ravi Saravanan <sravisar@amd.com>
ASoC: SOF: amd: acp7x: reload firmware from disk on S4 resume
This commit clears fw_code_carveout_addr on S4 resume in
amd_sof_acp7x_resume() so acp7x_load_firmware_carveout() reloads and
re-validates the firmware into the ASP carveout after hibernation.
> diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
> index 0d208df621e29..4ad54e5b4f660 100644
> --- a/sound/soc/sof/amd/acp.c
> +++ b/sound/soc/sof/amd/acp.c
> @@ -1672,6 +1672,15 @@ int amd_sof_acp7x_resume(struct snd_sof_dev *sdev)
> return ret;
> }
>
> + /*
> + * S4 powers down the carveout, invalidating its cached firmware. Clear
> + * fw_code_carveout_addr to force a full reload via VALIDATE_IMAGE on
> + * resume instead of a SHA-DMA from the stale carveout.
> + */
> + if (acp_data->asp_carveout_base &&
> + sdev->system_suspend_target == SOF_SUSPEND_S4)
> + acp_data->fw_code_carveout_addr = 0;
[Severity: High]
Does placing this check at the end of amd_sof_acp7x_resume() leave
acp_data->fw_code_carveout_addr set when acp_data->sdw_en_stat is true?
When SoundWire managers suspend in clock-stop mode,
amd_sof_acp7x_suspend() sets acp_data->sdw_en_stat via
check_acp_sdw_enable_status(), causing amd_sof_acp7x_resume() to return
early:
sound/soc/sof/amd/acp.c:amd_sof_acp7x_resume() {
...
if (acp_data->sdw_en_stat) {
snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP7X_ZSC_DSP_CTRL, 0);
snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP7X_PME_EN, 1);
return acp_dsp_reset(sdev);
}
...
}
sof_resume() still calls snd_sof_boot_dsp_firmware() afterwards, so on S4
resume acp7x_load_firmware_carveout() will skip VALIDATE_IMAGE and
SHA-DMA from the unpopulated carveout. Similarly, if acp_init() or
acp_memory_init() fails before reaching this check, snd_sof_complete()
resets sdev->system_suspend_target to SOF_SUSPEND_NONE without clearing
fw_code_carveout_addr.
[Severity: Medium]
Can acp_data->fw_code_carveout_addr also remain set on S4 resume if the
system hibernates while sdev->fw_state is SOF_FW_CRASHED or
SOF_FW_BOOT_FAILED?
In snd_sof_prepare(), sdev->system_suspend_target is initialized to
SOF_SUSPEND_S3 and the function returns early before querying
acpi_target_system_state() when sdev->fw_state is SOF_FW_CRASHED or
SOF_FW_BOOT_FAILED:
sound/soc/sof/pm.c:snd_sof_prepare() {
...
/* default to S3 in case the followingaske fails */
sdev->system_suspend_target = SOF_SUSPEND_S3;
if (sdev->fw_state == SOF_FW_CRASHED ||
sdev->fw_state == SOF_FW_BOOT_FAILED)
return 0;
...
}
sof_suspend() then resets sdev->fw_state to SOF_FW_BOOT_NOT_STARTED
after snd_sof_dsp_suspend() returns, so on S4 resume
sdev->system_suspend_target is still SOF_SUSPEND_S3 and
acp7x_load_firmware_carveout() will SHA-DMA from the powered-down
carveout. Clearing fw_code_carveout_addr in amd_sof_acp7x_suspend()
when sdev->system_suspend_target > SOF_SUSPEND_S3 or sdev->fw_state is
SOF_FW_CRASHED or SOF_FW_BOOT_FAILED would avoid both issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261125053843.1611378-1-sravisar@amd.com?part=2
prev parent reply other threads:[~2026-11-25 6:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 5:38 [PATCH 0/2] ASoC: SOF: amd: acp7x: fix S4 resume with ASP carveout firmware loading sravisar
2026-11-25 5:38 ` [PATCH 1/2] ASoC: SOF: amd: acp7x: enable ACPI target power states sravisar
2026-11-25 5:38 ` [PATCH 2/2] ASoC: SOF: amd: acp7x: reload firmware from disk on S4 resume sravisar
2026-11-25 6:02 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-232637@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sravisar@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox