summaryrefslogtreecommitdiff
path: root/drivers/accel
diff options
context:
space:
mode:
authorLizhi Hou <lizhi.hou@amd.com>2025-11-06 10:05:21 -0800
committerLizhi Hou <lizhi.hou@amd.com>2025-11-07 08:52:29 -0800
commit1750e652a996382a8608ec70167c3719d0556bda (patch)
tree8a2a5a0503099f7852bacaabfe484a3d8dceb895 /drivers/accel
parent9942d36a73c2d46c52fdd6f37cf698f3cb09ce5c (diff)
downloadlinux-1750e652a996382a8608ec70167c3719d0556bda.tar.gz
linux-1750e652a996382a8608ec70167c3719d0556bda.tar.bz2
linux-1750e652a996382a8608ec70167c3719d0556bda.zip
accel/amdxdna: Treat power-off failure as unrecoverable error
Failing to set power off indicates an unrecoverable hardware or firmware error. Update the driver to treat such a failure as a fatal condition and stop further operations that depend on successful power state transition. This prevents undefined behavior when the hardware remains in an unexpected state after a failed power-off attempt. Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com> Link: https://patch.msgid.link/20251106180521.1095218-1-lizhi.hou@amd.com
Diffstat (limited to 'drivers/accel')
-rw-r--r--drivers/accel/amdxdna/aie2_smu.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/accel/amdxdna/aie2_smu.c b/drivers/accel/amdxdna/aie2_smu.c
index 11c0e9e7b03a..bd94ee96c2bc 100644
--- a/drivers/accel/amdxdna/aie2_smu.c
+++ b/drivers/accel/amdxdna/aie2_smu.c
@@ -147,6 +147,16 @@ int aie2_smu_init(struct amdxdna_dev_hdl *ndev)
{
int ret;
+ /*
+ * Failing to set power off indicates an unrecoverable hardware or
+ * firmware error.
+ */
+ ret = aie2_smu_exec(ndev, AIE2_SMU_POWER_OFF, 0, NULL);
+ if (ret) {
+ XDNA_ERR(ndev->xdna, "Access power failed, ret %d", ret);
+ return ret;
+ }
+
ret = aie2_smu_exec(ndev, AIE2_SMU_POWER_ON, 0, NULL);
if (ret) {
XDNA_ERR(ndev->xdna, "Power on failed, ret %d", ret);