Skip to content

Commit 9aecc37

Browse files
houlz0507Sasha Levin
authored andcommitted
accel/amdxdna: Fix suspend failure after enabling turbo mode
[ Upstream commit fdb65ac ] 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: f4d7b8a ("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 Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ac24537 commit 9aecc37

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/accel/amdxdna/aie2_pci.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ static void aie2_hw_stop(struct amdxdna_dev *xdna)
341341
return;
342342
}
343343

344+
aie2_runtime_cfg(ndev, AIE2_RT_CFG_CLK_GATING, NULL);
344345
aie2_mgmt_fw_fini(ndev);
345346
xdna_mailbox_stop_channel(ndev->mgmt_chann);
346347
xdna_mailbox_destroy_channel(ndev->mgmt_chann);
@@ -424,15 +425,15 @@ static int aie2_hw_start(struct amdxdna_dev *xdna)
424425
goto stop_psp;
425426
}
426427

427-
ret = aie2_pm_init(ndev);
428+
ret = aie2_mgmt_fw_init(ndev);
428429
if (ret) {
429-
XDNA_ERR(xdna, "failed to init pm, ret %d", ret);
430+
XDNA_ERR(xdna, "initial mgmt firmware failed, ret %d", ret);
430431
goto destroy_mgmt_chann;
431432
}
432433

433-
ret = aie2_mgmt_fw_init(ndev);
434+
ret = aie2_pm_init(ndev);
434435
if (ret) {
435-
XDNA_ERR(xdna, "initial mgmt firmware failed, ret %d", ret);
436+
XDNA_ERR(xdna, "failed to init pm, ret %d", ret);
436437
goto destroy_mgmt_chann;
437438
}
438439

0 commit comments

Comments
 (0)