linux/drivers/accel
Taimuraz Kaitmazov b1da2a6cc1 accel/amdxdna: do not fail a sync for a BO with no debug context
amdxdna_drm_sync_bo_ioctl() calls amdxdna_hwctx_sync_debug_bo() for every
FROM_DEVICE sync, which answers -EINVAL when the BO's assigned_hwctx names
no context. Only a BO attached with ATTACH_DEBUG_BO is ever given one, so
an ordinary read-back sync reports failure after its flush has already run.

Ask for the debug sync only when the BO has a context. An unattached BO
carries AMDXDNA_INVALID_CTX_HANDLE and hwctx ids are allocated above it, so
the test is exact, -EINVAL keeps meaning that the named context is gone,
and the handle is not resolved twice. The field is written under dev_lock
and read here without it; the context is still resolved under that lock, so
a racing attach only decides whether this sync sees the buffer.

Fixes: 7ea0468380 ("accel/amdxdna: Support firmware debug buffer")
Suggested-by: Lizhi Hou <lizhi.hou@amd.com>
Signed-off-by: Taimuraz Kaitmazov <taimuraz@kaitmazov.com>
Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260819224458.257346-6-taimuraz@kaitmazov.com
2026-09-17 13:09:10 -07:00
..
amdxdna accel/amdxdna: do not fail a sync for a BO with no debug context 2026-09-17 13:09:10 -07:00
ethosu Merge drm/drm-next into drm-misc-next 2026-09-07 13:44:24 +02:00
habanalabs Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
ivpu accel/ivpu: Move register poll timeouts to vdev->timeout 2026-09-17 09:35:08 +02:00
qaic Merge drm/drm-next into drm-misc-next 2026-09-07 13:44:24 +02:00
rocket treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
drm_accel.c drm: move drm based debugfs funcs to drm_debugfs.c 2025-07-04 15:58:22 +02:00
Kconfig accel: Add Arm Ethos-U NPU driver 2025-10-24 15:07:39 -05:00
Makefile accel: Add Arm Ethos-U NPU driver 2025-10-24 15:07:39 -05:00