From: Mario Limonciello <mario.limonciello@amd.com>
To: <mario.limonciello@amd.com>, <lizhi.hou@amd.com>,
<mamin506@gmail.com>, <ogabbay@kernel.org>, <superm1@kernel.org>
Cc: <dri-devel@lists.freedesktop.org>
Subject: [PATCH 2/2] accel/amdxdna: Reduce log noise during process termination
Date: Tue, 10 Feb 2026 10:42:51 -0600 [thread overview]
Message-ID: <20260210164521.1094274-3-mario.limonciello@amd.com> (raw)
In-Reply-To: <20260210164521.1094274-1-mario.limonciello@amd.com>
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: 97f27573837e ("accel/amdxdna: Fix potential NULL pointer dereference in context cleanup")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
drivers/accel/amdxdna/aie2_ctx.c | 6 ++++--
drivers/accel/amdxdna/aie2_message.c | 4 +++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
index 37d05f2e986f9..79f6316655e73 100644
--- a/drivers/accel/amdxdna/aie2_ctx.c
+++ b/drivers/accel/amdxdna/aie2_ctx.c
@@ -497,7 +497,7 @@ static void aie2_release_resource(struct amdxdna_hwctx *hwctx)
if (AIE2_FEATURE_ON(xdna->dev_handle, AIE2_TEMPORAL_ONLY)) {
ret = aie2_destroy_context(xdna->dev_handle, hwctx);
- if (ret)
+ if (ret && ret != -ENODEV)
XDNA_ERR(xdna, "Destroy temporal only context failed, ret %d", ret);
} else {
ret = xrs_release_resource(xdna->xrs_hdl, (uintptr_t)hwctx);
@@ -1070,6 +1070,8 @@ void aie2_hmm_invalidate(struct amdxdna_gem_obj *abo,
ret = dma_resv_wait_timeout(gobj->resv, DMA_RESV_USAGE_BOOKKEEP,
true, MAX_SCHEDULE_TIMEOUT);
- if (!ret || ret == -ERESTARTSYS)
+ if (!ret)
XDNA_ERR(xdna, "Failed to wait for bo, ret %ld", ret);
+ else if (ret == -ERESTARTSYS)
+ XDNA_DBG(xdna, "Wait for bo interrupted by signal");
}
diff --git a/drivers/accel/amdxdna/aie2_message.c b/drivers/accel/amdxdna/aie2_message.c
index 77e3cdf18658b..5697c0c2dd43f 100644
--- a/drivers/accel/amdxdna/aie2_message.c
+++ b/drivers/accel/amdxdna/aie2_message.c
@@ -216,8 +216,10 @@ static int aie2_destroy_context_req(struct amdxdna_dev_hdl *ndev, u32 id)
req.context_id = id;
ret = aie2_send_mgmt_msg_wait(ndev, &msg);
- if (ret)
+ if (ret && ret != -ENODEV)
XDNA_WARN(xdna, "Destroy context failed, ret %d", ret);
+ else if (ret == -ENODEV)
+ XDNA_DBG(xdna, "Destroy context: device already stopped");
return ret;
}
--
2.53.0
next prev parent reply other threads:[~2026-02-10 16:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 16:42 [PATCH 0/2] amdxdna: fixes for closing a process Mario Limonciello
2026-02-10 16:42 ` [PATCH 1/2] accel/amdxdna: Fix NULL pointer dereference in mailbox channel cleanup Mario Limonciello
2026-02-10 17:17 ` Lizhi Hou
2026-02-11 6:21 ` Claude review: " Claude Code Review Bot
2026-02-10 16:42 ` Mario Limonciello [this message]
2026-02-10 17:20 ` [PATCH 2/2] accel/amdxdna: Reduce log noise during process termination Lizhi Hou
2026-02-11 6:21 ` Claude review: " Claude Code Review Bot
2026-02-11 6:21 ` Claude review: amdxdna: fixes for closing a process Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260210164521.1094274-3-mario.limonciello@amd.com \
--to=mario.limonciello@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=lizhi.hou@amd.com \
--cc=mamin506@gmail.com \
--cc=ogabbay@kernel.org \
--cc=superm1@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox