OSDN Git Service

habanalabs: verify that kernel CB is destroyed only once
authorTomer Tayar <ttayar@habana.ai>
Tue, 6 Dec 2022 17:54:10 +0000 (19:54 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Thu, 26 Jan 2023 09:52:10 +0000 (11:52 +0200)
commite2a079a206869b5e2164afa15bdf8d6d6299ca13
treecb748d9bc7e7715a2bfe8f9d4243a75cb4ea850c
parent20faaeec3794661c1d73578316691174a5a0e5a9
habanalabs: verify that kernel CB is destroyed only once

Remove the distinction between user CB and kernel CB, and verify for
both that they are not destroyed more than once.

As kernel CB might be taken from the pre-allocated CB pool, so we need
to clear the handle destroyed indication when returning a CB to the
pool.

Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/accel/habanalabs/common/command_buffer.c
drivers/accel/habanalabs/common/device.c
drivers/accel/habanalabs/common/habanalabs.h
drivers/accel/habanalabs/common/habanalabs_drv.c
drivers/accel/habanalabs/common/memory_mgr.c