]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
accel/amdxdna: Fix deadlock on debug BO command timeout
authorLizhi Hou <lizhi.hou@amd.com>
Tue, 7 Jul 2026 05:57:32 +0000 (22:57 -0700)
committerLizhi Hou <lizhi.hou@amd.com>
Tue, 7 Jul 2026 17:04:43 +0000 (10:04 -0700)
commitc8d2530791cb53602ac06ec2db6287d99f51cdbc
treefd52de3ff58ba9f0e3d6aefb24110ab557af6da8
parent66ff5c0eee02c4be67f8ba7fb6c63709ef1c92a3
accel/amdxdna: Fix deadlock on debug BO command timeout

Both amdxdna_hwctx_sync_debug_bo() and amdxdna_drm_config_hwctx_ioctl()
hold xdna->dev_lock while invoking backend operations. If the hardware
hangs, aie2_cmd_wait() blocks waiting for a firmware response. When the
DRM scheduler timeout expires, aie2_sched_job_timedout() is invoked to
reset the hardware. However, the timeout handler also attempts to acquire
dev_lock, resulting in a deadlock.

Avoid this by releasing dev_lock before waiting for the firmware
response and reacquiring it after the wait completes. This allows the
timeout handler to proceed with device recovery when a debug BO command
times out.

Fixes: 7ea046838021 ("accel/amdxdna: Support firmware debug buffer")
Reviewed-by: Max Zhen <max.zhen@amd.com>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260707055732.479103-1-lizhi.hou@amd.com
drivers/accel/amdxdna/aie2_ctx.c
drivers/accel/amdxdna/amdxdna_ctx.c