linux/drivers/accel/amdxdna
Lizhi Hou d5b8b0347f accel/amdxdna: Split mailbox channel create function
The management channel used for firmware control command submission is
currently created after the firmware is started. If channel creation
fails (for example, due to memory allocation failure or workqueue
creation interruption), the firmware remains in a pending state and is
unable to receive any control commands.

To avoid leaving the firmware in this inconsistent state, split
xdna_mailbox_create_channel() into two separate functions so that
resource allocation can be completed before interacting with the
hardware.
  xdna_mailbox_alloc_channel()
    Allocates memory and initializes the workqueue. This can be called
    earlier, before interacting with the hardware.
  xdna_mailbox_start_channel()
    Performs the hardware interaction required to start the channel.

Rename xdna_mailbox_destroy_channel() to xdna_mailbox_free_channel().
Ensure that xdna_mailbox_stop_channel() and xdna_mailbox_free_channel()
properly unwind the corresponding start and allocation steps, respectively.

Fixes: b87f920b93 ("accel/amdxdna: Support hardware mailbox")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260305062041.3954024-1-lizhi.hou@amd.com
2026-03-05 09:24:33 -08:00
..
aie2_ctx.c accel/amdxdna: Fill invalid payload for failed command 2026-02-27 23:01:36 -08:00
aie2_error.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
aie2_message.c accel/amdxdna: Split mailbox channel create function 2026-03-05 09:24:33 -08:00
aie2_msg_priv.h accel/amdxdna: Enable hardware context priority 2025-12-18 10:36:44 -08:00
aie2_pci.c accel/amdxdna: Split mailbox channel create function 2026-03-05 09:24:33 -08:00
aie2_pci.h accel/amdxdna: Fix NULL pointer dereference of mgmt_chann 2026-03-02 09:43:22 -08:00
aie2_pm.c accel/amdxdna: Fix dead lock for suspend and resume 2026-02-23 09:24:17 -08:00
aie2_psp.c accel/amdxdna: Poll MPNPU_PWAITMODE after requesting firmware suspend 2025-12-02 16:31:14 -08:00
aie2_smu.c accel/amdxdna: Fix incorrect DPM level after suspend/resume 2026-02-04 13:08:35 -08:00
aie2_solver.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
aie2_solver.h accel/amdxdna: Enhance power management settings 2024-12-16 15:50:32 -06:00
amdxdna_ctx.c accel/amdxdna: Fill invalid payload for failed command 2026-02-27 23:01:36 -08:00
amdxdna_ctx.h accel/amdxdna: Fill invalid payload for failed command 2026-02-27 23:01:36 -08:00
amdxdna_error.h accel/amdxdna: Support getting last hardware error 2025-10-16 09:32:48 -07:00
amdxdna_gem.c accel/amdxdna: Remove buffer size check when creating command BO 2026-02-23 09:23:41 -08:00
amdxdna_gem.h accel/amdxdna: Support firmware debug buffer 2025-10-20 09:07:12 -07:00
amdxdna_mailbox.c accel/amdxdna: Split mailbox channel create function 2026-03-05 09:24:33 -08:00
amdxdna_mailbox.h accel/amdxdna: Split mailbox channel create function 2026-03-05 09:24:33 -08:00
amdxdna_mailbox_helper.c accel/amdxdna: Remove casting mailbox payload pointer 2025-01-13 14:21:39 -06:00
amdxdna_mailbox_helper.h accel/amdxdna: Add IOCTL parameter for telemetry data 2025-11-04 09:04:21 -08:00
amdxdna_pci_drv.c accel/amdxdna: Use a different name for latest firmware 2026-02-25 13:51:31 -08:00
amdxdna_pci_drv.h accel/amdxdna: Hold mm structure across iommu_sva_unbind_device() 2026-01-30 11:52:45 -08:00
amdxdna_pm.c accel/amdxdna: Fix dead lock for suspend and resume 2026-02-23 09:24:17 -08:00
amdxdna_pm.h accel/amdxdna: Fix dead lock for suspend and resume 2026-02-23 09:24:17 -08:00
amdxdna_sysfs.c accel/amdxdna: Add command execution 2024-11-22 11:43:27 -07:00
amdxdna_ubuf.c accel/amdxdna: Prevent ubuf size overflow 2026-02-23 09:24:21 -08:00
amdxdna_ubuf.h accel/amdxdna: Support user space allocated buffer 2025-07-22 08:34:29 -07:00
Kconfig
Makefile accel/amdxdna: Remove NPU2 support 2025-12-18 10:36:22 -08:00
npu1_regs.c accel/amdxdna: Fix major version check on NPU1 platform 2026-03-04 12:05:02 -08:00
npu4_regs.c accel/amdxdna: Use a different name for latest firmware 2026-02-25 13:51:31 -08:00
npu5_regs.c accel/amdxdna: Use a different name for latest firmware 2026-02-25 13:51:31 -08:00
npu6_regs.c accel/amdxdna: Use a different name for latest firmware 2026-02-25 13:51:31 -08:00
TODO accel/amdxdna: Support firmware debug buffer 2025-10-20 09:07:12 -07:00