On Thu, Mar 20, 2025 at 04:24:32PM +0100, Stefano Garzarella wrote:
From: Stefano Garzarella <sgarzare@xxxxxxxxxx>
Some devices do not support interrupts and provide a single operation
to send the command and receive the response on the same buffer.
To support this scenario, a driver could set TPM_CHIP_FLAG_IRQ in the
chip's flags to get recv() to be called immediately after send() in
tpm_try_transmit(), or it needs to implement .status() to return 0,
and set both .req_complete_mask and .req_complete_val to 0.
In order to simplify these drivers and avoid temporary buffers to be
Simplification can be addressed with no callback changes:
https://lore.kernel.org/linux-integrity/20250326161838.123606-1-jarkko@xxxxxxxxxx/T/#u
I also noticed that tpm_ftpm_tee initalized req_complete_mask and
req_complete_val explictly while they would be already implicitly
zero.
So it reduces this just a matter of getting rid off the extra
buffer.
used between the .send() and .recv() callbacks, introduce a new callback
send_recv(). If that callback is defined, it is called in
tpm_try_transmit() to send the command and receive the response on
the same buffer in a single call.
I don't find anything in the commit message addressing buf_len an
cmd_len (vs "just len"). Why two lengths are required?
Not completely rejecting but this explanation is incomplete.