From: Mario Limonciello <superm1@kernel.org>
To: Lizhi Hou <lizhi.hou@amd.com>,
ogabbay@kernel.org, quic_jhugo@quicinc.com,
dri-devel@lists.freedesktop.org, karol.wachowski@linux.intel.com
Cc: linux-kernel@vger.kernel.org, max.zhen@amd.com, sonal.santan@amd.com
Subject: Re: [PATCH V1] accel/amdxdna: Return errors for failed debug BO commands
Date: Sun, 31 May 2026 15:17:31 +0200 [thread overview]
Message-ID: <11e636a3-8338-4f87-8519-1b38af62a00f@kernel.org> (raw)
In-Reply-To: <20260529162122.1976376-1-lizhi.hou@amd.com>
On 5/29/26 18:21, Lizhi Hou wrote:
> 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")
> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
> drivers/accel/amdxdna/aie2_ctx.c | 13 +++++--------
> 1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
> index 2ad343728782..da89b3701f5b 100644
> --- a/drivers/accel/amdxdna/aie2_ctx.c
> +++ b/drivers/accel/amdxdna/aie2_ctx.c
> @@ -305,17 +305,13 @@ aie2_sched_drvcmd_resp_handler(void *handle, void __iomem *data, size_t size)
> 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;
> }
> @@ -940,6 +936,7 @@ static int aie2_hwctx_cfg_debug_bo(struct amdxdna_hwctx *hwctx, u32 bo_hdl,
> aie2_cmd_wait(hwctx, seq);
> if (cmd.result) {
> XDNA_ERR(xdna, "Response failure 0x%x", cmd.result);
> + ret = -EINVAL;
> goto put_obj;
> }
>
next prev parent reply other threads:[~2026-05-31 13:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 16:21 [PATCH V1] accel/amdxdna: Return errors for failed debug BO commands Lizhi Hou
2026-05-31 13:17 ` Mario Limonciello [this message]
2026-06-04 6:14 ` Claude review: " Claude Code Review Bot
2026-06-04 6:14 ` 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=11e636a3-8338-4f87-8519-1b38af62a00f@kernel.org \
--to=superm1@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=karol.wachowski@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizhi.hou@amd.com \
--cc=max.zhen@amd.com \
--cc=ogabbay@kernel.org \
--cc=quic_jhugo@quicinc.com \
--cc=sonal.santan@amd.com \
/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