linux/drivers/tee/optee
Sumit Garg 7269cba53d tee: optee: Fix supplicant based device enumeration
Currently supplicant dependent optee device enumeration only registers
devices whenever tee-supplicant is invoked for the first time. But it
forgets to remove devices when tee-supplicant daemon stops running and
closes its context gracefully. This leads to following error for fTPM
driver during reboot/shutdown:

[   73.466791] tpm tpm0: ftpm_tee_tpm_op_send: SUBMIT_COMMAND invoke error: 0xffff3024

Fix this by adding an attribute for supplicant dependent devices so that
the user-space service can detect and detach supplicant devices before
closing the supplicant:

$ for dev in /sys/bus/tee/devices/*; do if [[ -f "$dev/need_supplicant" && -f "$dev/driver/unbind" ]]; \
      then echo $(basename "$dev") > $dev/driver/unbind; fi done

Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
Closes: https://github.com/OP-TEE/optee_os/issues/6094
Fixes: 5f178bb71e ("optee: enable support for multi-stage bus enumeration")
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
[jw: fixed up Date documentation]
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2023-11-03 09:27:20 +01:00
..
call.c tee: optee: Fix typo Unuspported -> Unsupported 2023-03-14 11:57:03 +01:00
core.c optee: Add __init/__exit annotations to module init/exit funcs 2022-10-11 11:20:16 +02:00
device.c tee: optee: Fix supplicant based device enumeration 2023-11-03 09:27:20 +01:00
ffa_abi.c firmware: arm_ffa: Split up ffa_ops into info, message and memory operations 2022-09-08 11:34:04 +01:00
Kconfig tee: optee: Add SMC for loading OP-TEE image 2023-04-03 08:57:49 +02:00
Makefile optee: separate notification functions 2021-11-17 14:08:56 +01:00
notif.c optee: Use bitmap_free() to free bitmap 2022-01-24 12:53:34 +01:00
optee_ffa.h optee: add FF-A capability OPTEE_FFA_SEC_CAP_ARG_OFFSET 2022-04-13 07:37:48 +02:00
optee_msg.h tee: optee: Add SMC for loading OP-TEE image 2023-04-03 08:57:49 +02:00
optee_private.h tee: Remove unused declarations 2023-09-13 08:16:24 +02:00
optee_rpc_cmd.h optee: separate notification functions 2021-11-17 14:08:56 +01:00
optee_smc.h tee: optee: Add SMC for loading OP-TEE image 2023-04-03 08:57:49 +02:00
optee_trace.h tee: optee: add invoke_fn tracepoints 2021-03-15 12:04:01 +01:00
rpc.c optee: separate notification functions 2021-11-17 14:08:56 +01:00
smc_abi.c ARM: SoC drivers for 6.5 2023-06-29 15:22:19 -07:00
supp.c