From 94362f3f186fa549cfe6ed16d7be6f85faca9be8 Mon Sep 17 00:00:00 2001 From: Siva Subramanian Ravi Saravanan Date: Thu, 29 Oct 2026 16:08:34 +0530 Subject: [PATCH 1/2] ASoC: SOF: amd: acp7x: enable ACPI target power states The ACP7.x suspend and resume handlers need to tell S4 (hibernate) apart from S3, because the ASP firmware carveout in DDR loses its contents across S4 but not across S3. They rely on sdev->system_suspend_target for this, but snd_sof_prepare() only derives it from acpi_target_system_state() when the device descriptor sets use_acpi_target_states. Otherwise system_suspend_target stays at its SOF_SUSPEND_S3 default and the S4 path is never taken. Set use_acpi_target_states in the ACP7.B and ACP7.F descriptors so that system_suspend_target reflects the actual target state (S0ix, S3, S4 or S5). Signed-off-by: Siva Subramanian Ravi Saravanan --- sound/soc/sof/amd/pci-acp7x.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/sof/amd/pci-acp7x.c b/sound/soc/sof/amd/pci-acp7x.c index 5a21ab8ebb4b9b..b27798f2007bcf 100644 --- a/sound/soc/sof/amd/pci-acp7x.c +++ b/sound/soc/sof/amd/pci-acp7x.c @@ -66,6 +66,7 @@ static const struct sof_dev_desc acp7b_desc = { .nocodec_tplg_filename = "sof-acp.tplg", .ops = &sof_acp7x_ops, .ops_init = sof_acp7x_ops_init, + .use_acpi_target_states = true, }; static const struct sof_amd_acp_desc acp7f_chip_info = { @@ -108,6 +109,7 @@ static const struct sof_dev_desc acp7f_desc = { .nocodec_tplg_filename = "sof-acp.tplg", .ops = &sof_acp7x_ops, .ops_init = sof_acp7x_ops_init, + .use_acpi_target_states = true, }; static const struct pci_device_id acp7b_pci_id = { From 1230869af11085e36640584d31ddbbf66cb26a2d Mon Sep 17 00:00:00 2001 From: Siva Subramanian Ravi Saravanan Date: Thu, 29 Oct 2026 17:21:48 +0530 Subject: [PATCH 2/2] ASoC: SOF: amd: acp7x: reload firmware from disk on S4 resume On S4 (hibernate) the ASP carveout in DDR loses power, so the raw firmware image previously deposited there by VALIDATE_IMAGE is gone. acp7x_load_firmware_carveout() skips VALIDATE_IMAGE whenever fw_code_carveout_addr is already set and SHA-DMAs directly from the carveout, which on S4 resume would read an empty carveout and fail to boot the DSP. Clear fw_code_carveout_addr on S4 resume so the loader takes the full request_firmware() + VALIDATE_IMAGE path and re-deposits the image into the carveout. S3 resume is unaffected, as the carveout contents are preserved across S3. Fixes: cec3598305a6 ("ASoC: SOF: amd: add ASP carveout firmware loading for ACP7.B/7.F") Signed-off-by: Siva Subramanian Ravi Saravanan --- sound/soc/sof/amd/acp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c index 86e2402b8ffd26..e81eafcafe25e6 100644 --- a/sound/soc/sof/amd/acp.c +++ b/sound/soc/sof/amd/acp.c @@ -1639,6 +1639,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; + return 0; } EXPORT_SYMBOL_NS(amd_sof_acp7x_resume, "SND_SOC_SOF_AMD_COMMON");