Skip to content

Commit c503a8b

Browse files
superm1Sasha Levin
authored andcommitted
accel/amdxdna: Reduce log noise during process termination
[ Upstream commit 57aa391 ] 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 Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent a631770 commit c503a8b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

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
@@ -193,8 +193,10 @@ static int aie2_destroy_context_req(struct amdxdna_dev_hdl *ndev, u32 id)
193193

194194
req.context_id = id;
195195
ret = aie2_send_mgmt_msg_wait(ndev, &msg);
196-
if (ret)
196+
if (ret && ret != -ENODEV)
197197
XDNA_WARN(xdna, "Destroy context failed, ret %d", ret);
198+
else if (ret == -ENODEV)
199+
XDNA_DBG(xdna, "Destroy context: device already stopped");
198200

199201
return ret;
200202
}

0 commit comments

Comments
 (0)