The config and sync debug BO commands currently may report success even
when the operation fails.
Capture the firmware return status and propagate the corresponding error
to userspace.
Fixes: 7ea046838021 ("accel/amdxdna: Support firmware debug buffer")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260529162122.1976376-1-lizhi.hou@amd.com
struct amdxdna_sched_job *job = handle;
int ret = 0;
- if (unlikely(!data))
- goto out;
-
- if (unlikely(size != sizeof(u32))) {
+ if (unlikely(!data || size != sizeof(u32))) {
+ job->drv_cmd->result = U32_MAX;
ret = -EINVAL;
- goto out;
+ } else {
+ job->drv_cmd->result = readl(data);
}
- job->drv_cmd->result = readl(data);
-
-out:
aie2_sched_notify(job);
return ret;
}
aie2_cmd_wait(hwctx, seq);
if (cmd.result) {
XDNA_ERR(xdna, "Response failure 0x%x", cmd.result);
+ ret = -EINVAL;
goto put_obj;
}