From: Lizhi Hou Date: Fri, 24 Oct 2025 16:26:08 +0000 (-0700) Subject: accel/amdxdna: Fix incorrect return value in aie2_hwctx_sync_debug_bo() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=41ee90230c571161a948f175134ca0e083de3ca2;p=thirdparty%2Fkernel%2Flinux.git accel/amdxdna: Fix incorrect return value in aie2_hwctx_sync_debug_bo() When the driver issues the SYNC_DEBUG_BO command, it currently returns 0 even if the firmware fails to execute the command. Update the driver to return -EINVAL in this case to properly indicate the failure. Reported-by: Dan Carpenter Closes: https://lore.kernel.org/dri-devel/aPsadTBXunUSBByV@stanley.mountain/ Fixes: 7ea046838021 ("accel/amdxdna: Support firmware debug buffer") Reviewed-by: Mario Limonciello (AMD) Signed-off-by: Lizhi Hou Link: https://patch.msgid.link/20251024162608.1544842-1-lizhi.hou@amd.com --- diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c index 63450b7773ac1..c6c473c783522 100644 --- a/drivers/accel/amdxdna/aie2_ctx.c +++ b/drivers/accel/amdxdna/aie2_ctx.c @@ -879,7 +879,7 @@ int aie2_hwctx_sync_debug_bo(struct amdxdna_hwctx *hwctx, u32 debug_bo_hdl) aie2_cmd_wait(hwctx, seq); if (cmd.result) { XDNA_ERR(xdna, "Response failure 0x%x", cmd.result); - return ret; + return -EINVAL; } return 0;