mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] tee: optee: Fixes for supplicant dependent enumeration
@ 2023-10-30 15:58 Sumit Garg
  2023-10-30 15:59 ` [PATCH v3 1/2] tee: optee: Fix supplicant based device enumeration Sumit Garg
  2023-10-30 15:59 ` [PATCH v3 2/2] tee: optee: Remove redundant custom workqueue Sumit Garg
  0 siblings, 2 replies; 10+ messages in thread
From: Sumit Garg @ 2023-10-30 15:58 UTC (permalink / raw)
  To: jens.wiklander, op-tee
  Cc: jan.kiszka, arnd, ardb, jerome.forissier, ilias.apalodimas,
	masahisa.kojima, maxim.uvarov, jarkko.sakkinen, linux-kernel,
	diogo.ivo, Sumit Garg

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 separating supplicant dependent devices so that the
user-space service can detach supplicant devices before closing the
supplicant. While at it use the global system workqueue for OP-TEE bus
scanning work rather than our own custom one.

Changes in v3:

- Split patch into 2 separate ones, one for supplicant fix and other for
  the workqueue. 

Changes in v2:

- Use device names to separate out tee-supplicant dependent devices via
  this patch.
- Since user-space service is aware about tee-supplicant lifespan, so
  allow the user-space service to unbind tee-supplicant dependent
  devices before killing the supplicant. Following command has to be
  added to the tee-supplicant service file.

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

Sumit Garg (2):
  tee: optee: Fix supplicant based device enumeration
  tee: optee: Remove redundant custom workqueue

 drivers/tee/optee/core.c          | 13 ++-----------
 drivers/tee/optee/device.c        | 13 ++++++++++---
 drivers/tee/optee/optee_private.h |  2 --
 3 files changed, 12 insertions(+), 16 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-11-02  8:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-30 15:58 [PATCH v3 0/2] tee: optee: Fixes for supplicant dependent enumeration Sumit Garg
2023-10-30 15:59 ` [PATCH v3 1/2] tee: optee: Fix supplicant based device enumeration Sumit Garg
2023-10-31 11:04   ` Jerome Forissier
2023-10-31 11:44     ` Jan Kiszka
2023-11-02  7:37       ` Sumit Garg
2023-11-02  7:58         ` Jan Kiszka
2023-11-02  8:02           ` Sumit Garg
2023-11-02  8:05             ` Jan Kiszka
2023-11-02  8:09               ` Sumit Garg
2023-10-30 15:59 ` [PATCH v3 2/2] tee: optee: Remove redundant custom workqueue Sumit Garg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®