optee: separate notification functions
authorJens Wiklander <jens.wiklander@linaro.org>
Tue, 15 Jun 2021 20:23:53 +0000 (22:23 +0200)
committerJens Wiklander <jens.wiklander@linaro.org>
Wed, 17 Nov 2021 13:08:56 +0000 (14:08 +0100)
commit787c80cc7b22804aa370f04a19f9fe0fa98b1e49
treee833cd4cb6be34a1a9feb90a0ec33696ff9349c5
parent1e2c3ef0496e72ba9001da5fd1b7ed56ccb30597
optee: separate notification functions

Renames struct optee_wait_queue to struct optee_notif and all related
functions to optee_notif_*().

The implementation is changed to allow sending a notification from an
atomic state, that is from the top half of an interrupt handler.

Waiting for keys is currently only used when secure world is waiting for
a mutex or condition variable. The old implementation could handle any
32-bit key while this new implementation is restricted to only 8 bits or
the maximum value 255. A upper value is needed since a bitmap is
allocated to allow an interrupt handler to only set a bit in case the
waiter hasn't had the time yet to allocate and register a completion.

The keys are currently only representing secure world threads which
number usually are never even close to 255 so it should be safe for now.
In future ABI updates the maximum value of the key will be communicated
while the driver is initializing.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/tee/optee/Makefile
drivers/tee/optee/core.c
drivers/tee/optee/ffa_abi.c
drivers/tee/optee/notif.c [new file with mode: 0644]
drivers/tee/optee/optee_private.h
drivers/tee/optee/optee_rpc_cmd.h
drivers/tee/optee/rpc.c
drivers/tee/optee/smc_abi.c