]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
accel/amdxdna: Fix cu_idx being cleared by memset() during command setup
authorLizhi Hou <lizhi.hou@amd.com>
Tue, 9 Dec 2025 21:16:39 +0000 (13:16 -0800)
committerLizhi Hou <lizhi.hou@amd.com>
Wed, 10 Dec 2025 17:07:18 +0000 (09:07 -0800)
commit3d32eb7a5ecff92d83a5fd34c45c171c17d3d5d0
treef1a87f9bc963167be739a2943b5a9b24aba3fedf
parentff9e240212f6693c293f9e58ade05bc887297a1e
accel/amdxdna: Fix cu_idx being cleared by memset() during command setup

For one command type, cu_idx is assigned before calling memset() on the
command structure. This results in cu_idx being overwritten, causing the
firmware to receive an incomplete or invalid command and leading to
unexpected command failures.

Fix this by moving the memset() call before initializing cu_idx so that
all fields are populated in the correct order.

Fixes: 71829d7f2f70 ("accel/amdxdna: Use MSG_OP_CHAIN_EXEC_NPU when supported")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20251209211639.1636888-1-lizhi.hou@amd.com
drivers/accel/amdxdna/aie2_message.c