From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Kuldeep Singh <kuldeep.singh@oss.qualcomm.com>,
Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>,
Jens Wiklander <jenswi@kernel.org>,
Sumit Garg <sumit.garg@kernel.org>,
Peter Huewe <peterhuewe@gmx.de>,
Jarkko Sakkinen <jarkko@kernel.org>,
Jason Gunthorpe <jgg@ziepe.ca>
Cc: linux-arm-msm@vger.kernel.org, op-tee@lists.trustedfirmware.org,
linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org
Subject: Re: [PATCH 2/2] firmware: tpm: Introduce tpm-qcom driver
Date: Mon, 31 Aug 2026 13:15:14 +0200 [thread overview]
Message-ID: <e7f7f0ea-cb63-41f2-93c6-5d47fe4cca3b@oss.qualcomm.com> (raw)
In-Reply-To: <20260831-tpm_qcom_driver-v1-2-6f16fa6924fa@oss.qualcomm.com>
On 8/31/26 11:43 AM, Kuldeep Singh wrote:
> Add a TPM chip driver for platforms where a TPM 2.0 instance is
> implemented by a Trusted Application (TA) running in Qualcomm's Trusted
> Execution Environment (QTEE), reachable over the QCOMTEE object-IPC
> transport.
[...]
> +static int tpm_qcom_get_client_env_obj(struct tee_context *ctx,
> + struct tee_param_objref *client_env_obj)
> +{
> + int ret;
> + struct tee_ioctl_object_invoke_arg inv_arg;
> + struct tee_param param[2];
nit: Reverse-Christmas-tree would be preferred
> +
> + memset(&inv_arg, 0, sizeof(inv_arg));
> + memset(¶m, 0, sizeof(param));
You can zero-initialize local struct variables like this:
struct foo bar = { };
[...]
> +static int tpm_qcom_send(struct tpm_chip *chip, u8 *buf, size_t bufsiz,
> + size_t cmd_len)
> +{
> + struct tpm_qcom_private *pvt_data = dev_get_drvdata(chip->dev.parent);
> + size_t rsp_len = PAGE_ALIGN(MAX_RESPONSE_SIZE);
> + size_t copy_len;
> + int ret;
> +
> + if (cmd_len > MAX_COMMAND_SIZE) {
> + dev_err(&chip->dev,
> + "%s: len=%zd exceeds MAX_COMMAND_SIZE\n",
> + __func__, cmd_len);
The name of the function isn't helpful here, this is the only time this
message appears, so it's easy to grep
[...]
> + err = tpm_chip_register(pvt_data->chip);
> + if (err) {
> + dev_err(dev, "%s: tpm_chip_register failed with rc=%d\n",
> + __func__, err);
Likewise
[...]
> +#define QCOMTEE_TPM_GET_TA_VERSION_ID 0x0001000
> +#define QCOMTEE_TPM_TA_VERSION_GET_MAJOR(ver) ((u32)(ver) >> 16)
> +#define QCOMTEE_TPM_TA_VERSION_GET_MINOR(ver) ((u32)(ver) & 0x0000ffffU)
That's FIELD_GET(mask, x)
Konrad
next prev parent reply other threads:[~2026-08-31 11:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 9:42 [PATCH 0/2] Add TPM support via Qualcomm TEE TPM TA Kuldeep Singh
2026-08-31 9:43 ` [PATCH 1/2] tee: qcomtee: Register qcom.tz.tpm service for discovery Kuldeep Singh
2026-09-02 9:27 ` Kuldeep Singh
2026-08-31 9:43 ` [PATCH 2/2] firmware: tpm: Introduce tpm-qcom driver Kuldeep Singh
2026-08-31 11:15 ` Konrad Dybcio [this message]
2026-08-31 11:26 ` Kuldeep Singh
2026-09-01 13:46 ` Jarkko Sakkinen
2026-09-02 9:22 ` Kuldeep Singh
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=e7f7f0ea-cb63-41f2-93c6-5d47fe4cca3b@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=amirreza.zarrabi@oss.qualcomm.com \
--cc=jarkko@kernel.org \
--cc=jenswi@kernel.org \
--cc=jgg@ziepe.ca \
--cc=kuldeep.singh@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=op-tee@lists.trustedfirmware.org \
--cc=peterhuewe@gmx.de \
--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
all inboxes | Powered by JetHome®