]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tee: add close_context to TEE driver operation
authorAmirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Fri, 12 Sep 2025 04:07:43 +0000 (21:07 -0700)
committerJens Wiklander <jens.wiklander@linaro.org>
Mon, 15 Sep 2025 15:34:06 +0000 (17:34 +0200)
commit0cbaf65c91db0e40a577e8919979dac1963cfcc0
tree54fc3b990809335e298d4e91561002f421c734d6
parent6dbcd5a9ab6cb6644e7d728521da1c9035ec7235
tee: add close_context to TEE driver operation

The tee_context can be used to manage TEE user resources, including
those allocated by the driver for the TEE on behalf of the user.
The release() callback is invoked only when all resources, such as
tee_shm, are released and there are no references to the tee_context.

When a user closes the device file, the driver should notify the
TEE to release any resources it may hold and drop the context
references. To achieve this, a close_context() callback is
introduced to initiate resource release in the TEE driver when
the device file is closed.

Relocate teedev_ctx_get, teedev_ctx_put, tee_device_get, and
tee_device_get functions to tee_core.h to make them accessible
outside the TEE subsystem.

Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Harshal Dev <quic_hdev@quicinc.com>
Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/tee/tee_core.c
drivers/tee/tee_private.h
include/linux/tee_core.h