summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLizhi Hou <lizhi.hou@amd.com>2026-02-11 12:47:16 -0800
committerLizhi Hou <lizhi.hou@amd.com>2026-02-23 09:24:19 -0800
commitfdb65acfe655f844ae1e88696b9656d3ef5bb8fb (patch)
treeb1fe7518b7bc50e7699985bd53b800e79b8500ba /drivers
parent1aa82181a3c285c7351523d587f7981ae4c015c8 (diff)
downloadlinux-fdb65acfe655f844ae1e88696b9656d3ef5bb8fb.tar.gz
linux-fdb65acfe655f844ae1e88696b9656d3ef5bb8fb.zip
accel/amdxdna: Fix suspend failure after enabling turbo mode
Enabling turbo mode disables hardware clock gating. Suspend requires hardware clock gating to be re-enabled, otherwise suspend will fail. Fix this by calling aie2_runtime_cfg() from aie2_hw_stop() to re-enable clock gating during suspend. Also ensure that firmware is initialized in aie2_hw_start() before modifying clock-gating settings during resume. Fixes: f4d7b8a6bc8c ("accel/amdxdna: Enhance power management settings") Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com> Link: https://patch.msgid.link/20260211204716.722788-1-lizhi.hou@amd.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/accel/amdxdna/aie2_pci.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c
index 07e369507818..4b3e6bb97bd2 100644
--- a/drivers/accel/amdxdna/aie2_pci.c
+++ b/drivers/accel/amdxdna/aie2_pci.c
@@ -323,6 +323,7 @@ static void aie2_hw_stop(struct amdxdna_dev *xdna)
return;
}
+ aie2_runtime_cfg(ndev, AIE2_RT_CFG_CLK_GATING, NULL);
aie2_mgmt_fw_fini(ndev);
xdna_mailbox_stop_channel(ndev->mgmt_chann);
xdna_mailbox_destroy_channel(ndev->mgmt_chann);
@@ -406,15 +407,15 @@ static int aie2_hw_start(struct amdxdna_dev *xdna)
goto stop_psp;
}
- ret = aie2_pm_init(ndev);
+ ret = aie2_mgmt_fw_init(ndev);
if (ret) {
- XDNA_ERR(xdna, "failed to init pm, ret %d", ret);
+ XDNA_ERR(xdna, "initial mgmt firmware failed, ret %d", ret);
goto destroy_mgmt_chann;
}
- ret = aie2_mgmt_fw_init(ndev);
+ ret = aie2_pm_init(ndev);
if (ret) {
- XDNA_ERR(xdna, "initial mgmt firmware failed, ret %d", ret);
+ XDNA_ERR(xdna, "failed to init pm, ret %d", ret);
goto destroy_mgmt_chann;
}