]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
accel/amdxdna: Fix order of canceled mailbox messages
authorLizhi Hou <lizhi.hou@amd.com>
Mon, 13 Apr 2026 18:18:43 +0000 (11:18 -0700)
committerLizhi Hou <lizhi.hou@amd.com>
Tue, 14 Apr 2026 16:10:54 +0000 (09:10 -0700)
commitc83ad8ea6b0a53f1ed61ae0b4b9606bdfe338b33
tree0d19a5331e17bdf78ce01624be9adf3c7aaaa087
parent1bcfa4c4e88a554d1b6f98f4e3f886288581cbb4
accel/amdxdna: Fix order of canceled mailbox messages

Mailbox message IDs are allocated cyclically. When destroying a mailbox
channel, pending messages are canceled starting from message ID 0. This
results in an incorrect cancellation order when the ID of the last posted
message wraps around and is smaller than the ID of the first posted
message.

Fix this by canceling pending messages starting from the next available
message ID, ensuring the correct ordering across wraparound.

Fixes: a37d78470bcc ("accel/amdxdna: Replace idr api with xarray")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260413181843.670796-1-lizhi.hou@amd.com
drivers/accel/amdxdna/amdxdna_mailbox.c