diff options
author | Prachotan Bathi <prachotan.bathi@arm.com> | 2025-07-08 17:51:51 -0500 |
---|---|---|
committer | Jarkko Sakkinen <jarkko@kernel.org> | 2025-07-23 02:32:00 +0300 |
commit | 7f0c6675b3194461ad7bb8db1d822445121fb029 (patch) | |
tree | 93823d9b2d5533515e585a454c0014fd17271dd4 /scripts/lib/kdoc/kdoc_parser.py | |
parent | 586dafcdbc5004266a74bc280281e4ee92488633 (diff) |
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 <prachotan.bathi@arm.com>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_parser.py')
0 files changed, 0 insertions, 0 deletions