From: Arun Menon <armenon@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Jarkko Sakkinen <jarkko@kernel.org>,
linux-integrity@vger.kernel.org, Peter Huewe <peterhuewe@gmx.de>,
Jason Gunthorpe <jgg@ziepe.ca>, Arun Menon <armenon@redhat.com>
Subject: [PATCH v4 3/6] tpm_crb: Add start_cmd parameter to tpm_crb_start wrapper
Date: Mon, 26 Oct 2026 01:48:55 +0530 [thread overview]
Message-ID: <20261025201859.221991-4-armenon@redhat.com> (raw)
In-Reply-To: <20261025201859.221991-1-armenon@redhat.com>
From: Arun Menon <armenon@redhat.com>
The current implementation of tpm_crb_start() is limited to triggering
the CRB_START_INVOKE bit. To support command and response chunking, the
driver must be able to send other control bits, like
CRB_START_NEXT_CHUNK, using the same platform-specific paths.
This commit adds the start_cmd parameter to tpm_crb_start() so the
caller can specify which command to send.
Signed-off-by: Arun Menon <armenon@redhat.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
---
drivers/char/tpm/tpm_crb.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
index 9a2f512b4ae3..31f530744e90 100644
--- a/drivers/char/tpm/tpm_crb.c
+++ b/drivers/char/tpm/tpm_crb.c
@@ -446,7 +446,7 @@ static int tpm_crb_smc_start(struct device *dev, unsigned long func_id)
}
#endif
-static int tpm_crb_start(struct tpm_chip *chip)
+static int tpm_crb_start(struct tpm_chip *chip, u32 start_cmd)
{
struct crb_priv *priv = dev_get_drvdata(&chip->dev);
int rc = 0;
@@ -457,16 +457,16 @@ static int tpm_crb_start(struct tpm_chip *chip)
if (priv->sm == ACPI_TPM2_COMMAND_BUFFER ||
priv->sm == ACPI_TPM2_MEMORY_MAPPED ||
!strcmp(priv->hid, "MSFT0101"))
- iowrite32(CRB_START_INVOKE, &priv->regs_t->ctrl_start);
+ iowrite32(start_cmd, &priv->regs_t->ctrl_start);
if (priv->sm == ACPI_TPM2_START_METHOD ||
priv->sm == ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD)
rc = crb_do_acpi_start(chip);
if (priv->sm == ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC) {
- iowrite32(CRB_START_INVOKE, &priv->regs_t->ctrl_start);
+ iowrite32(start_cmd, &priv->regs_t->ctrl_start);
rc = tpm_crb_smc_start(&chip->dev, priv->smc_func_id);
}
if (priv->sm == ACPI_TPM2_CRB_WITH_ARM_FFA) {
- iowrite32(CRB_START_INVOKE, &priv->regs_t->ctrl_start);
+ iowrite32(start_cmd, &priv->regs_t->ctrl_start);
rc = tpm_crb_ffa_start(CRB_FFA_START_TYPE_COMMAND, chip->locality);
}
return rc;
@@ -497,7 +497,7 @@ static int crb_send(struct tpm_chip *chip, u8 *buf, size_t bufsiz, size_t len)
/* Make sure that cmd is populated before issuing start. */
wmb();
- rc = tpm_crb_start(chip);
+ rc = tpm_crb_start(chip, CRB_START_INVOKE);
if (rc)
return rc;
--
2.54.0
next prev parent reply other threads:[~2026-10-25 20:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-25 20:18 [PATCH v4 0/6] tpm_crb: Add command and response buffer chunking support Arun Menon
2026-10-25 20:18 ` [PATCH v4 1/6] tpm_crb: Add register definitions of TPM CRB chunking fields Arun Menon
2026-10-25 20:18 ` [PATCH v4 2/6] tpm_crb: Split start method into a separate header Arun Menon
2026-10-25 20:55 ` Jarkko Sakkinen
2026-10-25 20:56 ` Jarkko Sakkinen
2026-10-25 20:18 ` Arun Menon [this message]
2026-10-25 20:18 ` [PATCH v4 4/6] tpm: tis_i2c: Use local 4KB buffer to limit memory usage Arun Menon
2026-10-25 20:18 ` [PATCH v4 5/6] tpm: Increase TPM_BUFSIZE to 8kB for chunking support Arun Menon
2026-10-25 20:59 ` Jarkko Sakkinen
2026-10-25 21:00 ` Jarkko Sakkinen
2026-10-25 20:18 ` [PATCH v4 6/6] tpm_crb: Implement command and response chunking logic Arun Menon
2026-10-25 21:59 ` 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=20261025201859.221991-4-armenon@redhat.com \
--to=armenon@redhat.com \
--cc=jarkko@kernel.org \
--cc=jgg@ziepe.ca \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
/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®