From: Jarkko Sakkinen <jarkko@kernel.org>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
linux-kernel@vger.kernel.org, Peter Huewe <peterhuewe@gmx.de>,
linux-integrity@vger.kernel.org,
James Bottomley <James.Bottomley@hansenpartnership.com>,
Jens Wiklander <jens.wiklander@linaro.org>,
Sumit Garg <sumit.garg@kernel.org>
Subject: Re: [PATCH 1/2] tpm: add send_recv() op in tpm_class_ops
Date: Wed, 26 Mar 2025 18:53:51 +0200 [thread overview]
Message-ID: <Z-QxH7aDjlixl2gp@kernel.org> (raw)
In-Reply-To: <20250320152433.144083-2-sgarzare@redhat.com>
On Thu, Mar 20, 2025 at 04:24:32PM +0100, Stefano Garzarella wrote:
> From: Stefano Garzarella <sgarzare@redhat.com>
>
> 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@kernel.org/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.
BR, Jarkko
next prev parent reply other threads:[~2025-03-26 16:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-20 15:24 [PATCH 0/2] tpm: add send_recv() op and use it in tpm_ftpm_tee driver Stefano Garzarella
2025-03-20 15:24 ` [PATCH 1/2] tpm: add send_recv() op in tpm_class_ops Stefano Garzarella
2025-03-26 16:53 ` Jarkko Sakkinen [this message]
2025-03-27 9:48 ` Stefano Garzarella
2025-03-27 13:02 ` Jarkko Sakkinen
2025-03-27 14:44 ` Stefano Garzarella
2025-03-20 15:24 ` [PATCH 2/2] tpm/tpm_ftpm_tee: use send_recv() op Stefano Garzarella
2025-03-25 5:19 ` Sumit Garg
2025-03-26 12:11 ` Jarkko Sakkinen
2025-03-26 14:34 ` Jason Gunthorpe
2025-03-26 14:57 ` Jarkko Sakkinen
2025-03-26 15:58 ` Jarkko Sakkinen
2025-03-26 20:37 ` Jarkko Sakkinen
2025-03-27 9:27 ` Stefano Garzarella
2025-03-27 13:04 ` Jarkko Sakkinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z-QxH7aDjlixl2gp@kernel.org \
--to=jarkko@kernel.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=jens.wiklander@linaro.org \
--cc=jgg@ziepe.ca \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=sgarzare@redhat.com \
--cc=sumit.garg@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).