Skip to content

tee: optee: Fixes for supplicant dependent enumeration

Sumit Garg lkml op-tee 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 5 repliesIn review
  2. v32 patches 7 repliesSuperseded
  3. v21 patch 5 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch1 replySuperseded

Changes in v4 from the cover letter

- Changing the device name would be an ABI break, rather switch to additional device attribute: "need_supplicant" to distinguish for ABI compatibility.
- Dropped tested-by for patch #1, I would encourage folks to retest this.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tee: optee: Fix supplicant based device enumerationDocumentation/ABI/testing/sysfs-bus-optee-devices drivers/tee/optee/device.c+24 -24 replies
2/2tee: optee: Remove redundant custom workqueuedrivers/tee/optee/core.c drivers/tee/optee/optee_private.h+2 -130 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchJan KiszkaMasahisa KojimaJerome ForissierIlias Apalodimas
1/2A-b R-b
2/2T-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/2] tee: optee: Fixes for supplicant dependent 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

While at it use the global system workqueue for OP-TEE bus scanning work rather than our own custom one.

Changes in v4:
- Changing the device name would be an ABI break, rather switch to additional device attribute: "need_supplicant" to distinguish for ABI compatibility.
- Dropped tested-by for patch #1, I would encourage folks to retest this.

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

 .../ABI/testing/sysfs-bus-optee-devices         |  9 +++++++++
 drivers/tee/optee/core.c                        | 13 ++-----------
 drivers/tee/optee/device.c                      | 17 +++++++++++++++--
 drivers/tee/optee/optee_private.h               |  2 --
 4 files changed, 26 insertions(+), 15 deletions(-)
Signature · 1 line
2.34.1