]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
accel/amdxdna: Fix dead lock for suspend and resume
authorLizhi Hou <lizhi.hou@amd.com>
Wed, 11 Feb 2026 20:46:44 +0000 (12:46 -0800)
committerLizhi Hou <lizhi.hou@amd.com>
Mon, 23 Feb 2026 17:24:17 +0000 (09:24 -0800)
commit1aa82181a3c285c7351523d587f7981ae4c015c8
tree0f6e3d78dc171e87be8927cd4bafa12d456cb4f3
parent57aa3917a3b3bd805a3679371f97a1ceda3c5510
accel/amdxdna: Fix dead lock for suspend and resume

When an application issues a query IOCTL while auto suspend is running,
a deadlock can occur. The query path holds dev_lock and then calls
pm_runtime_resume_and_get(), which waits for the ongoing suspend to
complete. Meanwhile, the suspend callback attempts to acquire dev_lock
and blocks, resulting in a deadlock.

Fix this by releasing dev_lock before calling pm_runtime_resume_and_get()
and reacquiring it after the call completes. Also acquire dev_lock in the
resume callback to keep the locking consistent.

Fixes: 063db451832b ("accel/amdxdna: Enhance runtime power management")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260211204644.722758-1-lizhi.hou@amd.com
drivers/accel/amdxdna/aie2_ctx.c
drivers/accel/amdxdna/aie2_pci.c
drivers/accel/amdxdna/aie2_pm.c
drivers/accel/amdxdna/amdxdna_ctx.c
drivers/accel/amdxdna/amdxdna_pm.c
drivers/accel/amdxdna/amdxdna_pm.h