Skip to content

Commit 57aa391

Browse files
superm1houlz0507
authored andcommitted
accel/amdxdna: Reduce log noise during process termination
During process termination, several error messages are logged that are not actual errors but expected conditions when a process is killed or interrupted. This creates unnecessary noise in the kernel log. The specific scenarios are: 1. HMM invalidation returns -ERESTARTSYS when the wait is interrupted by a signal during process cleanup. This is expected when a process is being terminated and should not be logged as an error. 2. Context destruction returns -ENODEV when the firmware or device has already stopped, which commonly occurs during cleanup if the device was already torn down. This is also an expected condition during orderly shutdown. Downgrade these expected error conditions from error level to debug level to reduce log noise while still keeping genuine errors visible. Fixes: 97f2757 ("accel/amdxdna: Fix potential NULL pointer dereference in context cleanup") Reviewed-by: Lizhi Hou <lizhi.hou@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com> Link: https://patch.msgid.link/20260210164521.1094274-3-mario.limonciello@amd.com
1 parent 8363c02 commit 57aa391

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

drivers/accel/amdxdna/aie2_ctx.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ static void aie2_release_resource(struct amdxdna_hwctx *hwctx)
497497

498498
if (AIE2_FEATURE_ON(xdna->dev_handle, AIE2_TEMPORAL_ONLY)) {
499499
ret = aie2_destroy_context(xdna->dev_handle, hwctx);
500-
if (ret)
500+
if (ret && ret != -ENODEV)
501501
XDNA_ERR(xdna, "Destroy temporal only context failed, ret %d", ret);
502502
} else {
503503
ret = xrs_release_resource(xdna->xrs_hdl, (uintptr_t)hwctx);
@@ -1070,6 +1070,8 @@ void aie2_hmm_invalidate(struct amdxdna_gem_obj *abo,
10701070

10711071
ret = dma_resv_wait_timeout(gobj->resv, DMA_RESV_USAGE_BOOKKEEP,
10721072
true, MAX_SCHEDULE_TIMEOUT);
1073-
if (!ret || ret == -ERESTARTSYS)
1073+
if (!ret)
10741074
XDNA_ERR(xdna, "Failed to wait for bo, ret %ld", ret);
1075+
else if (ret == -ERESTARTSYS)
1076+
XDNA_DBG(xdna, "Wait for bo interrupted by signal");
10751077
}

drivers/accel/amdxdna/aie2_message.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,10 @@ static int aie2_destroy_context_req(struct amdxdna_dev_hdl *ndev, u32 id)
216216

217217
req.context_id = id;
218218
ret = aie2_send_mgmt_msg_wait(ndev, &msg);
219-
if (ret)
219+
if (ret && ret != -ENODEV)
220220
XDNA_WARN(xdna, "Destroy context failed, ret %d", ret);
221+
else if (ret == -ENODEV)
222+
XDNA_DBG(xdna, "Destroy context: device already stopped");
221223

222224
return ret;
223225
}

0 commit comments

Comments
 (0)