]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
accel/ivpu: fix HWS command queue leak on registration failure
authorKarol Wachowski <karol.wachowski@linux.intel.com>
Thu, 11 Jun 2026 05:51:40 +0000 (07:51 +0200)
committerKarol Wachowski <karol.wachowski@linux.intel.com>
Mon, 15 Jun 2026 07:01:01 +0000 (09:01 +0200)
commite7ab91e2bf01b024691d6ce488546533943e7a6b
treec24c3e972cb6ff870e1459358997e40dbddb59b9
parent2f41af638c92bac6f1f9275ea2d1901baef578f3
accel/ivpu: fix HWS command queue leak on registration failure

A command queue is considered valid and usable by the driver only when
it has a doorbell ID assigned (db_id != 0), meaning both the FW cmdq
creation and doorbell registration completed successfully.

However, when either ivpu_register_db() or set_context_sched_properties()
fails after ivpu_hws_cmdq_init() has already created the cmdq in FW,
the command queue is left registered in FW while the driver treats it as
uninitialized (db_id remains 0). On the next submission attempt the
driver tries to register the same cmdq again, which fails because FW
already has an entry for it.

Fix by calling ivpu_jsm_hws_destroy_cmdq() on error paths to properly
unwind FW state and allow subsequent registration attempts to succeed.

Fixes: 465a3914b254 ("accel/ivpu: Add API for command queue create/destroy/submit")
Reviewed-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://patch.msgid.link/20260611055140.948684-1-karol.wachowski@linux.intel.com
drivers/accel/ivpu/ivpu_job.c