From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.61.9 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796029386; b=qDso87eoSOgl7IeSCOv3tpqe5w2O746ntiBSGyq5o9N+z2EWTd9AoCTUAHQ7lG1hQLxY FFwvNRFqzia6RRD44QciwoQIHCfy+crhqpdR0J6OgBR5pT3ymn5u1f0EuQE6O5/czSGgw IjP6ESVrI9e3duTzdBP4Gn3ug/QqHA8yNwKL5cfxFWn1SAjSExBY/RxKnMKbvbRgvamvF GURn2ChnXYw+OsmPpod1/JHJK5wvva1UtV/TMxZ60uJTvUF58reEHR/U/RSMdjAC/SnMj RYex6bX8cpxMtaBBsZk49uC5BBFm6Mj8ln0kzyvqUmJnCqn0fZweFc6stBZv9XdEmLQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796029386; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: Received:Received:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding: Content-Type:X-EOPAttributedMessage:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam:X-Microsoft-Antispam-Message-Info: X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=KAGgfI/yeLOhGk6rrMcRns3jABKyjbaaNyHZnt0Ahhk=; b=JiMyouVVlciS/G+7l1T8KD6ysxQEHPjd3BRft0xubw7BCae3csSBSuutEo+M/ch3+DF+ KEAF9Qw5JAYcuJnareC5nH90uSrva+bzM30O48Yh4XwIzuyfqmbH+bEA+dc+g9F884vnQ J6v0H+pIu/OvK+mN7x5kO6zr9OhcX11/kKeSAtd560lNGFoQ3YF/Rvjj+0GIESM7nmCTc +SGS7MAvsJcXXzGOF5CP8mQdqFmN6yTePwYQGaO90Wz7URhe0Pff8p0QjGQuckkEotgi8 Nk5gTBwImBaYiUBT4v3SR/yQZmFHbZhaYw5sOfNtWDdvMMxml7uTKtHxIZxyPB6bsUw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b="o/WCApR0"; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.61.9 Received: from DM1PR04CU001.outbound.protection.outlook.com (mail-centralusazon11010009.outbound.protection.outlook.com [52.101.61.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3C1260A2602; Mon, 30 Nov 2026 09:03:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A3C1260A2602 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=o/WCApR0 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Z3WUmUEQ2hPO5q1u3SdWhu3wmgHCZ0REBKXTBQ30i6aal19SWc8q1HcfyIKoY1jBwSYsyLWVd0WKDPgRmy3OjnL35cY2CL97Tr6c+E78SOGINlCYSGjUkJ47/oc075YugkotzvgeY8DRToikEJQ+HrwezOpGwldZRbsNgFwEg/wdFHEY0r0HVf5i5AP1UFfCuhbU4JivE8RLEM87CFNihgoD8abtLIOiZ7e5irqyM5YPlZNIv2ESLGmoWD+u7RQmuvKvASO9v+fQJMw6oA01B3texFuiis5sGiOLMHeyKbWU2BCzFOOGLQ07gRSbcPZhgvbMVE9b1etxHDyeksLzaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KAGgfI/yeLOhGk6rrMcRns3jABKyjbaaNyHZnt0Ahhk=; b=o4Wj2RqbZnPhroD4qFT7VM+bx1zMK4sgoVEJJJYVWMbFDVIjSpGdmNh+i2n57r16aRvljkp8eEyMOzbLATmUKuI1KbJtjtOFOLw83olZIno7UHuYYuiLsQEJ8SBN146GUxWpVFrCY8WPjoUr3B5WA9+15O4PUMn2ojCjwrKDg1Kf8CWWh0xEYoPz+p2Rlhh406uzJq4UdOZveok1flml0WQJc5FWwaxxdsDT+ECmSSNruDNZrBeBBYy43VG2l5XnO/ZNqdAD8qNxiH4v4HsecM4SaiDmnF3863DyLSEfF3iAPVV6DZcYe1oaYzmFiOlOZq0zPa6l9y4hX5UAwKyLcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KAGgfI/yeLOhGk6rrMcRns3jABKyjbaaNyHZnt0Ahhk=; b=o/WCApR0/Mw58mnVMrY9qaz3AZk4OmyvuVK4j1Pqs+6dN9xLHgdjEtFMqUpG2D04jiKvHMn4r829SWJ5nYuyWUmQY2VVgC83Wpvo98Ko8JBeOFsoergAfHAsh4WkgkpTW9yztKRN2/cCdTI5Yq0OnqAQZuHpJIYjBM1NV6V6U5Y= Received: from BN3PR12CA0001.namprd12.prod.outlook.com (2603:10b6:408:2af::15) by DM4PR12MB7768.namprd12.prod.outlook.com (2603:10b6:8:102::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.12; Mon, 30 Nov 2026 09:03:01 +0000 Received: from BN5PEPF00046988.namprd02.prod.outlook.com (2603:10b6:408:2af:cafe::24) by BN3PR12CA0001.outlook.office365.com (2603:10b6:408:2af::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.662.13 via Frontend Transport; Mon, 30 Nov 2026 09:03:01 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb08.amd.com; pr=C Received: from satlexmb08.amd.com (165.204.84.17) by BN5PEPF00046988.mail.protection.outlook.com (10.167.245.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Mon, 30 Nov 2026 09:03:01 +0000 Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Mon, 30 Nov 2026 03:03:00 -0600 Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb10.amd.com (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Mon, 30 Nov 2026 03:03:00 -0600 Received: from sof-build.amd.com (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.57 via Frontend Transport; Mon, 30 Nov 2026 03:02:56 -0600 From: To: CC: , , , , , , , , , , , , , , , "Siva Subramanian Ravi Saravanan" Subject: [PATCH v2 2/2] ASoC: SOF: amd: acp7x: reload firmware from disk on S4 resume Date: Mon, 30 Nov 2026 14:32:23 +0530 Message-ID: <20261130090246.3653208-3-sravisar@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261130090246.3653208-1-sravisar@amd.com> References: <20261130090246.3653208-1-sravisar@amd.com> X-Mailing-List: linux-sound@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 Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN5PEPF00046988:EE_|DM4PR12MB7768:EE_ X-MS-Office365-Filtering-Correlation-Id: d21762c4-5660-4830-cd70-08df4ec0bca0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|23010399003|1800799024|82310400026|376014|10067099003|56012099006|261028144727099003|261026140227099003|261026121527099003|261022115727099003|261021121427099003|261102123227099003|261022105027099003|261022075727099003|261009223027099003|18002099003|22082099003|5023799004|11063799006|6133799003|13003099007; X-Microsoft-Antispam-Message-Info: e7iuaCZSaqIo9wbNP5IgiXFI+UWs2j/Z+6YkMrCmwQJOVDa9mlufdF/RQSMaX06KoqW7td3C/Iij1llscEY+NSE1Dr+Kz6Y9iqllZ9XE3kI6rYIr9q3jBbdotzdQb4gQ5lI7WBHhqpOwCm5GSiHBZxiedUYM6gK4C51q7LBalqOlVt0Cx+DAhsB6v4ZJslTrNOQIjJn8h+0O4ZyiB/VCAp9jg5SM/9oGcv/UPCv74oBbcXim/9wgYsSILQtsQbiT7o8a5VV7MwFZcNcORfqDirQpsnDV6YOLNFvmK+g6COUrCzBCALdNKrS00mQuZ/M+tIrxOI0CMJj7SclK1fZWxejgLKKdpB7CMnUc8zAY9vget0sBo0DAXdwejDyty/Ctt1Bae43kktojFxHQ9jepXsY9u5gSZM8itsSpePcoojpuImaWfvks1CXOhSvrtJOgsKgmqt7VDl80DzNwnyNn7oACkd3LSRjhNfaE+7hfS9g9GuHVKkMEIMNX82aBYCzlXH5z6vBcQCGhwscaRSmxRzrDliyYhjiG/XJX+jesPg6SeuISMwaHxwvrBS5kjS6JKg80xkQL5fq/ua1iBa01PmrrQ/PApHdQ7Byow3Gcxunib2GFGy91bBgHyx9ntJ0aXopSz0zDdmnJ3bZOHFRwsetNa/UxrfsLzsebPmWB9O8= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(23010399003)(1800799024)(82310400026)(376014)(10067099003)(56012099006)(261028144727099003)(261026140227099003)(261026121527099003)(261022115727099003)(261021121427099003)(261102123227099003)(261022105027099003)(261022075727099003)(261009223027099003)(18002099003)(22082099003)(5023799004)(11063799006)(6133799003)(13003099007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: s7z2RAiP8GRghU7m4OushcccjHNEQZfpL9qFKn+0NtMYqKyLbp3Cz/MJuohJOC/WWgfpjKgspvKVyWp/sGEx3ZuPnOlxHCMsCYlgaSeRk+8aQLc2+YbOk661le9HdUe8UJUtChuxSDECNsWBi+XnyOcOGuWZVrjGPr/UENX+9L70/PbxSVWbCt2DSpLyiBfFQAkbET7cVDFUY1KIQCCxzHSD3F22VARaC57ch2tYSu9EtCwZOGsYiZBQDg0ExJUNAY3OlqzrerfYdd4xeIX36REVKjR+94kiJPDye7oJiiYK6+Q61mz8l3MPg/NmctpuNrOC7pcHrrKFxYclb/VH6G+XscqnmxT07ue98Qt/vSs49dJNvZpVCCM2x3E5R4EVfpuD/V1rw/DpiE/6bun9FVLHaKusQVQsvAsMWSo6zmDEYqPJGOzSU0KMjKZy6xzS X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2026 09:03:01.4859 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d21762c4-5660-4830-cd70-08df4ec0bca0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN5PEPF00046988.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7768 From: Siva Subramanian Ravi Saravanan 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 at the start of amd_sof_acp7x_resume() when the system suspend target is deeper than S3, so the loader takes the full request_firmware() + VALIDATE_IMAGE path and re-deposits the image into the carveout. Doing this before the SoundWire clock-stop and acp_init()/acp_memory_init() early returns ensures it is never skipped. Resume is used rather than suspend because the platform suspend callback is not invoked when the DSP is already runtime suspended. snd_sof_prepare() leaves the target at S3 without querying ACPI when the firmware has crashed or failed to boot, so S4 cannot be detected in that case. Also clear fw_code_carveout_addr in amd_sof_acp7x_suspend() for those firmware states. S0ix/s2idle resume is unaffected and keeps the fast SHA-DMA path, as the carveout contents are preserved. Fixes: cec3598305a6 ("ASoC: SOF: amd: add ASP carveout firmware loading for ACP7.B/7.F") Signed-off-by: Siva Subramanian Ravi Saravanan --- Changes in v2: - Clear fw_code_carveout_addr at the start of resume, before the early returns, and for S4/S5. - Also clear it on suspend if the firmware has crashed or failed to boot. - Link to v1: https://lore.kernel.org/all/20261125053843.1611378-1-sravisar@amd.com/ sound/soc/sof/amd/acp.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c index 0d208df621e29..b93330dcf22e8 100644 --- a/sound/soc/sof/amd/acp.c +++ b/sound/soc/sof/amd/acp.c @@ -1585,6 +1585,12 @@ int amd_sof_acp7x_suspend(struct snd_sof_dev *sdev, u32 target_state) acp_data = sdev->pdata->hw_pdata; + /* snd_sof_prepare() can't detect S4 if FW crashed; reload from disk */ + if (acp_data->asp_carveout_base && + (sdev->fw_state == SOF_FW_CRASHED || + sdev->fw_state == SOF_FW_BOOT_FAILED)) + acp_data->fw_code_carveout_addr = 0; + if (acp_data->is_sdw_dev && check_acp_sdw_enable_status(sdev)) { snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP7X_ZSC_DSP_CTRL, 1); return acp_dsp_reset(sdev); @@ -1655,6 +1661,11 @@ int amd_sof_acp7x_resume(struct snd_sof_dev *sdev) acp_data = sdev->pdata->hw_pdata; + /* Carveout is unpowered in S4/S5; force a full firmware reload */ + if (acp_data->asp_carveout_base && + sdev->system_suspend_target > SOF_SUSPEND_S3) + acp_data->fw_code_carveout_addr = 0; + 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); -- 2.43.0