Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 97f27573837e ("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

authored by

Mario Limonciello and committed by
Lizhi Hou
57aa3917 8363c028

+7 -3
+4 -2
drivers/accel/amdxdna/aie2_ctx.c
··· 497 497 498 498 if (AIE2_FEATURE_ON(xdna->dev_handle, AIE2_TEMPORAL_ONLY)) { 499 499 ret = aie2_destroy_context(xdna->dev_handle, hwctx); 500 - if (ret) 500 + if (ret && ret != -ENODEV) 501 501 XDNA_ERR(xdna, "Destroy temporal only context failed, ret %d", ret); 502 502 } else { 503 503 ret = xrs_release_resource(xdna->xrs_hdl, (uintptr_t)hwctx); ··· 1070 1070 1071 1071 ret = dma_resv_wait_timeout(gobj->resv, DMA_RESV_USAGE_BOOKKEEP, 1072 1072 true, MAX_SCHEDULE_TIMEOUT); 1073 - if (!ret || ret == -ERESTARTSYS) 1073 + if (!ret) 1074 1074 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"); 1075 1077 }
+3 -1
drivers/accel/amdxdna/aie2_message.c
··· 216 216 217 217 req.context_id = id; 218 218 ret = aie2_send_mgmt_msg_wait(ndev, &msg); 219 - if (ret) 219 + if (ret && ret != -ENODEV) 220 220 XDNA_WARN(xdna, "Destroy context failed, ret %d", ret); 221 + else if (ret == -ENODEV) 222 + XDNA_DBG(xdna, "Destroy context: device already stopped"); 221 223 222 224 return ret; 223 225 }