Skip to content

Commit fdb65ac

Browse files
committed
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: 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
1 parent 1aa8218 commit fdb65ac

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/accel/amdxdna/aie2_pci.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ static void aie2_hw_stop(struct amdxdna_dev *xdna)
323323
return;
324324
}
325325

326+
aie2_runtime_cfg(ndev, AIE2_RT_CFG_CLK_GATING, NULL);
326327
aie2_mgmt_fw_fini(ndev);
327328
xdna_mailbox_stop_channel(ndev->mgmt_chann);
328329
xdna_mailbox_destroy_channel(ndev->mgmt_chann);
@@ -406,15 +407,15 @@ static int aie2_hw_start(struct amdxdna_dev *xdna)
406407
goto stop_psp;
407408
}
408409

409-
ret = aie2_pm_init(ndev);
410+
ret = aie2_mgmt_fw_init(ndev);
410411
if (ret) {
411-
XDNA_ERR(xdna, "failed to init pm, ret %d", ret);
412+
XDNA_ERR(xdna, "initial mgmt firmware failed, ret %d", ret);
412413
goto destroy_mgmt_chann;
413414
}
414415

415-
ret = aie2_mgmt_fw_init(ndev);
416+
ret = aie2_pm_init(ndev);
416417
if (ret) {
417-
XDNA_ERR(xdna, "initial mgmt firmware failed, ret %d", ret);
418+
XDNA_ERR(xdna, "failed to init pm, ret %d", ret);
418419
goto destroy_mgmt_chann;
419420
}
420421

0 commit comments

Comments
 (0)