linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/1] tpm/tpm_ftpm_tee: add shutdown call back
@ 2019-12-04 15:40 Pavel Tatashin
  2019-12-04 15:40 ` [PATCH v4 1/1] " Pavel Tatashin
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Tatashin @ 2019-12-04 15:40 UTC (permalink / raw)
  To: pasha.tatashin, jmorris, sashal, peterhuewe, jarkko.sakkinen,
	jgg, linux-kernel, linux-doc, linux-integrity, linux-kernel,
	thiruan, bryankel, tee-dev, ilias.apalodimas, sumit.garg,
	rdunlap

Changes from v3:
 - Synced with mainline
 - Added Tested-by Sasha Levin, and Reviewed-by: Jarkko Sakkinen.

Previous versions:
v3:
https://lore.kernel.org/lkml/20191016163114.985542-1-pasha.tatashin@soleen.com
v2:
https://lore.kernel.org/lkml/20191014202135.429009-1-pasha.tatashin@soleen.com
v1:
https://lore.kernel.org/lkml/20191011145721.59257-1-pasha.tatashin@soleen.com


Pavel Tatashin (1):
  tpm/tpm_ftpm_tee: add shutdown call back

 drivers/char/tpm/tpm_ftpm_tee.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

-- 
2.24.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v4 1/1] tpm/tpm_ftpm_tee: add shutdown call back
  2019-12-04 15:40 [PATCH v4 0/1] tpm/tpm_ftpm_tee: add shutdown call back Pavel Tatashin
@ 2019-12-04 15:40 ` Pavel Tatashin
  2019-12-09 19:51   ` Jarkko Sakkinen
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Tatashin @ 2019-12-04 15:40 UTC (permalink / raw)
  To: pasha.tatashin, jmorris, sashal, peterhuewe, jarkko.sakkinen,
	jgg, linux-kernel, linux-doc, linux-integrity, linux-kernel,
	thiruan, bryankel, tee-dev, ilias.apalodimas, sumit.garg,
	rdunlap

Add shutdown call back to close existing session with fTPM TA
to support kexec scenario.

Add parentheses to function names in comments as specified in kdoc.

Signed-off-by: Thirupathaiah Annapureddy <thiruan@microsoft.com>
Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Sasha Levin <sashal@kernel.org>
---
 drivers/char/tpm/tpm_ftpm_tee.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/char/tpm/tpm_ftpm_tee.c b/drivers/char/tpm/tpm_ftpm_tee.c
index 6640a14dbe48..22bf553ccf9d 100644
--- a/drivers/char/tpm/tpm_ftpm_tee.c
+++ b/drivers/char/tpm/tpm_ftpm_tee.c
@@ -32,7 +32,7 @@ static const uuid_t ftpm_ta_uuid =
 		  0x82, 0xCB, 0x34, 0x3F, 0xB7, 0xF3, 0x78, 0x96);
 
 /**
- * ftpm_tee_tpm_op_recv - retrieve fTPM response.
+ * ftpm_tee_tpm_op_recv() - retrieve fTPM response.
  * @chip:	the tpm_chip description as specified in driver/char/tpm/tpm.h.
  * @buf:	the buffer to store data.
  * @count:	the number of bytes to read.
@@ -61,7 +61,7 @@ static int ftpm_tee_tpm_op_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 }
 
 /**
- * ftpm_tee_tpm_op_send - send TPM commands through the TEE shared memory.
+ * ftpm_tee_tpm_op_send() - send TPM commands through the TEE shared memory.
  * @chip:	the tpm_chip description as specified in driver/char/tpm/tpm.h
  * @buf:	the buffer to send.
  * @len:	the number of bytes to send.
@@ -208,7 +208,7 @@ static int ftpm_tee_match(struct tee_ioctl_version_data *ver, const void *data)
 }
 
 /**
- * ftpm_tee_probe - initialize the fTPM
+ * ftpm_tee_probe() - initialize the fTPM
  * @pdev: the platform_device description.
  *
  * Return:
@@ -298,7 +298,7 @@ static int ftpm_tee_probe(struct platform_device *pdev)
 }
 
 /**
- * ftpm_tee_remove - remove the TPM device
+ * ftpm_tee_remove() - remove the TPM device
  * @pdev: the platform_device description.
  *
  * Return:
@@ -328,6 +328,19 @@ static int ftpm_tee_remove(struct platform_device *pdev)
 	return 0;
 }
 
+/**
+ * ftpm_tee_shutdown() - shutdown the TPM device
+ * @pdev: the platform_device description.
+ */
+static void ftpm_tee_shutdown(struct platform_device *pdev)
+{
+	struct ftpm_tee_private *pvt_data = dev_get_drvdata(&pdev->dev);
+
+	tee_shm_free(pvt_data->shm);
+	tee_client_close_session(pvt_data->ctx, pvt_data->session);
+	tee_client_close_context(pvt_data->ctx);
+}
+
 static const struct of_device_id of_ftpm_tee_ids[] = {
 	{ .compatible = "microsoft,ftpm" },
 	{ }
@@ -341,6 +354,7 @@ static struct platform_driver ftpm_tee_driver = {
 	},
 	.probe = ftpm_tee_probe,
 	.remove = ftpm_tee_remove,
+	.shutdown = ftpm_tee_shutdown,
 };
 
 module_platform_driver(ftpm_tee_driver);
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v4 1/1] tpm/tpm_ftpm_tee: add shutdown call back
  2019-12-04 15:40 ` [PATCH v4 1/1] " Pavel Tatashin
@ 2019-12-09 19:51   ` Jarkko Sakkinen
  0 siblings, 0 replies; 3+ messages in thread
From: Jarkko Sakkinen @ 2019-12-09 19:51 UTC (permalink / raw)
  To: Pavel Tatashin
  Cc: jmorris, sashal, peterhuewe, jgg, linux-kernel, linux-doc,
	linux-integrity, linux-kernel, thiruan, bryankel, tee-dev,
	ilias.apalodimas, sumit.garg, rdunlap

On Wed, Dec 04, 2019 at 10:40:38AM -0500, Pavel Tatashin wrote:
> Add shutdown call back to close existing session with fTPM TA
> to support kexec scenario.
> 
> Add parentheses to function names in comments as specified in kdoc.
> 
> Signed-off-by: Thirupathaiah Annapureddy <thiruan@microsoft.com>
> Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> Tested-by: Sasha Levin <sashal@kernel.org>

LGTM, can apply the patch soon'ish.

/Jarkko

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-09 19:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-04 15:40 [PATCH v4 0/1] tpm/tpm_ftpm_tee: add shutdown call back Pavel Tatashin
2019-12-04 15:40 ` [PATCH v4 1/1] " Pavel Tatashin
2019-12-09 19:51   ` Jarkko Sakkinen

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).