aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/mpi/mpi-sub-ui.c
diff options
context:
space:
mode:
authorPrachotan Bathi <[email protected]>2025-07-08 22:51:51 +0000
committerJarkko Sakkinen <[email protected]>2025-07-22 23:32:00 +0000
commit7f0c6675b3194461ad7bb8db1d822445121fb029 (patch)
tree93823d9b2d5533515e585a454c0014fd17271dd4 /lib/crypto/mpi/mpi-sub-ui.c
parenttpm_crb_ffa: Remove memset usage (diff)
downloadkernel-7f0c6675b3194461ad7bb8db1d822445121fb029.tar.gz
kernel-7f0c6675b3194461ad7bb8db1d822445121fb029.zip
tpm_crb_ffa: handle tpm busy return code
Platforms supporting direct message request v2 [1] can support secure partitions that support multiple services. For CRB over FF-A interface, if the firmware TPM or TPM service [1] shares its Secure Partition (SP) with another service, message requests may fail with a -EBUSY error. To handle this, replace the single check and call with a retry loop that attempts the TPM message send operation until it succeeds or a configurable timeout is reached. Implement a _try_send_receive function to do a single send/receive and modify the existing send_receive to add this retry loop. The retry mechanism introduces a module parameter (`busy_timeout_ms`, default: 2000ms) to control how long to keep retrying on -EBUSY responses. Between retries, the code waits briefly (50-100 microseconds) to avoid busy-waiting and handling TPM BUSY conditions more gracefully. The parameter can be modified at run-time as such: echo 3000 | tee /sys/module/tpm_crb_ffa/parameters/busy_timeout_ms This changes the timeout from the default 2000ms to 3000ms. [1] TPM Service Command Response Buffer Interface Over FF-A https://developer.arm.com/documentation/den0138/latest/ Signed-off-by: Prachotan Bathi <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
Diffstat (limited to 'lib/crypto/mpi/mpi-sub-ui.c')
0 files changed, 0 insertions, 0 deletions