From: Lizhi Hou <lizhi.hou@amd.com>
To: Taimuraz Kaitmazov <taimuraz@kaitmazov.com>, <mamin506@gmail.com>,
<ogabbay@kernel.org>
Cc: <christian.koenig@amd.com>, <sumit.semwal@linaro.org>,
<alexdeucher@gmail.com>, <max.zhen@amd.com>,
<sonal.santan@amd.com>, <dri-devel@lists.freedesktop.org>,
<linux-kernel@vger.kernel.org>, <linux-media@vger.kernel.org>,
<linaro-mm-sig@lists.linaro.org>
Subject: Re: [PATCH v4 5/5] accel/amdxdna: do not fail a sync for a BO with no debug context
Date: Wed, 19 Aug 2026 14:05:01 -0700 [thread overview]
Message-ID: <bf6b34f5-eeb5-ad54-388b-24223a37d111@amd.com> (raw)
In-Reply-To: <20260817230707.356828-6-taimuraz@kaitmazov.com>
On 8/17/26 16:07, Taimuraz Kaitmazov wrote:
> amdxdna_drm_sync_bo_ioctl() calls amdxdna_hwctx_sync_debug_bo() for every
> FROM_DEVICE sync, which answers -EINVAL when the BO has no assigned hwctx.
> Only a BO attached with ATTACH_DEBUG_BO ever gets one, so an ordinary
> read-back sync reports failure after its flush has already run.
>
> There is no debug buffer to sync in that case, so answer success.
>
> Signed-off-by: Taimuraz Kaitmazov <taimuraz@kaitmazov.com>
> ---
> drivers/accel/amdxdna/amdxdna_ctx.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/accel/amdxdna/amdxdna_ctx.c b/drivers/accel/amdxdna/amdxdna_ctx.c
> index 855da8c79a1c..c0d0aa53c596 100644
> --- a/drivers/accel/amdxdna/amdxdna_ctx.c
> +++ b/drivers/accel/amdxdna/amdxdna_ctx.c
> @@ -416,7 +416,8 @@ int amdxdna_hwctx_sync_debug_bo(struct amdxdna_client *client, u32 debug_bo_hdl)
> guard(mutex)(&xdna->dev_lock);
> hwctx = xa_load(&client->hwctx_xa, abo->assigned_hwctx);
> if (!hwctx) {
> - ret = -EINVAL;
> + /* Not attached as a debug BO, so there is nothing to sync. */
> + ret = 0;
It should check assigned_hwctx before entering this function:
if (abo->assigned_hwctx != AMDXDNA_INVALID_CTX_HANDLE &&
args->direction == SYNC_DIRECT_FROM_DEVICE)
ret = amdxdna_hwctx_sync_debug_bo(client, args->handle);
Thanks,
Lizhi
> goto put_obj;
> }
>
prev parent reply other threads:[~2026-08-19 21:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260817230707.356828-1-taimuraz@kaitmazov.com>
[not found] ` <1bd1644d-bc8a-45b7-af72-af64bc35ccb6@kaitmazov.com>
2026-08-19 16:30 ` [PATCH v4 0/5] accel/amdxdna: SYNC_BO correctness fixes Lizhi Hou
[not found] ` <20260817230707.356828-2-taimuraz@kaitmazov.com>
2026-08-19 20:39 ` [PATCH v4 1/5] accel/amdxdna: refuse an I/O memory mapping of an imported BO Lizhi Hou
[not found] ` <20260817230707.356828-3-taimuraz@kaitmazov.com>
2026-08-19 20:49 ` [PATCH v4 2/5] accel/amdxdna: check the sync range for overflow on a device BO Lizhi Hou
[not found] ` <20260817230707.356828-4-taimuraz@kaitmazov.com>
2026-08-19 20:57 ` [PATCH v4 3/5] accel/amdxdna: do not warn when a sync request is rejected Lizhi Hou
[not found] ` <20260817230707.356828-5-taimuraz@kaitmazov.com>
2026-08-19 21:00 ` [PATCH v4 4/5] accel/amdxdna: refuse to flush an imported BO Lizhi Hou
[not found] ` <20260817230707.356828-6-taimuraz@kaitmazov.com>
2026-08-19 21:05 ` Lizhi Hou [this message]
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=bf6b34f5-eeb5-ad54-388b-24223a37d111@amd.com \
--to=lizhi.hou@amd.com \
--cc=alexdeucher@gmail.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mamin506@gmail.com \
--cc=max.zhen@amd.com \
--cc=ogabbay@kernel.org \
--cc=sonal.santan@amd.com \
--cc=sumit.semwal@linaro.org \
--cc=taimuraz@kaitmazov.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
all inboxes | Powered by JetHome®