Re: [GIT PULL] tpmdd updates for v4.16

2018-01-11 Thread Alexander Steffen
On 10.01.2018 17:08, Jarkko Sakkinen wrote: On Tue, Jan 09, 2018 at 10:59:07AM +0100, Alexander Steffen wrote: On 08.01.2018 12:18, Jarkko Sakkinen wrote: Hi James, Sorry for a late PR. Summary of the content: * Reduced polling delays in tpm_tis. * Support for retrieving TPM 2.0 Event Log

Re: [GIT PULL] tpmdd updates for v4.16

2018-01-09 Thread Alexander Steffen
On 08.01.2018 12:18, Jarkko Sakkinen wrote: Hi James, Sorry for a late PR. Summary of the content: * Reduced polling delays in tpm_tis. * Support for retrieving TPM 2.0 Event Log through EFI before ExitBootServices. * Replaced tpm-rng.c with a hwrng device managed by the driver for each

[PATCH] tpm-dev: Require response to be read only if there actually is a response

2018-12-06 Thread Alexander Steffen
-by: Alexander Steffen --- Feel free to merge this into Tadeusz' original commit. drivers/char/tpm/tpm-dev-common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm-dev-common.c b/drivers/char/tpm/tpm-dev-common.c index 344739223451..5eecad233ea1 1

Re: [PATCH v4 1/2] tpm: Unify the send callback behaviour

2019-02-11 Thread Alexander Steffen
his commit, but will add your tags after you have time to test. I ran all tests again and everything works now as expected :) Tested-by: Alexander Steffen Alexander

Re: [PATCH v2 1/6] hwrng: core: Freeze khwrng thread during suspend

2019-08-16 Thread Alexander Steffen
On 03.08.2019 00:50, Stephen Boyd wrote: Quoting Stephen Boyd (2019-07-17 10:03:22) Quoting Jason Gunthorpe (2019-07-17 09:50:11) On Wed, Jul 17, 2019 at 09:42:32AM -0700, Stephen Boyd wrote: Yes. That's exactly my point. A hwrng that's suspended will fail here and it's better to just not try

Re: [PATCH v2 0/2] char: tpm: add new driver for tpm i2c ptp

2019-08-16 Thread Alexander Steffen
On 15.08.2019 19:03, Oshri Alkobi wrote: On Thu, Jul 18, 2019 at 8:10 PM Alexander Steffen wrote: On 18.07.2019 14:51, eyal.co...@nuvoton.com wrote: Hi Jarkko and Alexander, We have made an additional code review on the TPM TIS core driver, it looks quite good and we can connect our new

Re: [PATCH v2 0/2] char: tpm: add new driver for tpm i2c ptp

2019-07-17 Thread Alexander Steffen
On 15.07.2019 10:08, Tomer Maimon wrote: Hi Jarkko and All, Thanks for your feedback and sorry for the late response. Due to the amount of work required to handle this technical feedback and project constraints we need to put this task on hold for the near future. In the meantime, anyone fr

Re: [PATCH v2 3/6] tpm_tis_spi: add max xfer size

2019-07-17 Thread Alexander Steffen
On 17.07.2019 00:45, Stephen Boyd wrote: From: Andrey Pronin Reject burstcounts larger than 64 bytes reported by tpm. This is not the correct thing to do here. To quote the specification: "burstCount is defined as the number of bytes that can be written to or read from the data FIFO by the

Re: [PATCH v2 5/6] tpm: add driver for cr50 on SPI

2019-07-17 Thread Alexander Steffen
On 17.07.2019 00:45, Stephen Boyd wrote: From: Andrey Pronin Add TPM2.0 PTP FIFO compatible SPI interface for chips with Cr50 firmware. The firmware running on the currently supported H1 Secure Microcontroller requires a special driver to handle its specifics: - need to ensure a certain delay

Re: [PATCH v2 6/6] tpm: Add driver for cr50 on I2C

2019-07-17 Thread Alexander Steffen
On 17.07.2019 00:45, Stephen Boyd wrote: From: Duncan Laurie Add TPM 2.0 compatible I2C interface for chips with cr50 firmware. The firmware running on the currently supported H1 MCU requires a special driver to handle its specific protocol, and this makes it unsuitable to use tpm_tis_core_* a

Re: [PATCH v2 5/6] tpm: add driver for cr50 on SPI

2019-07-18 Thread Alexander Steffen
On 17.07.2019 21:57, Stephen Boyd wrote: Quoting Alexander Steffen (2019-07-17 05:00:06) On 17.07.2019 00:45, Stephen Boyd wrote: From: Andrey Pronin +static unsigned short rng_quality = 1022; +module_param(rng_quality, ushort, 0644); +MODULE_PARM_DESC(rng_quality, + "Estim

Re: [PATCH v2 5/6] tpm: add driver for cr50 on SPI

2019-07-18 Thread Alexander Steffen
On 17.07.2019 23:38, Stephen Boyd wrote: Quoting Stephen Boyd (2019-07-17 12:57:34) Quoting Alexander Steffen (2019-07-17 05:00:06) Can't the code be shared more explicitly, e.g. by cr50_spi wrapping tpm_tis_spi, so that it can intercept the calls, execute the additional actions (like w

Re: [PATCH v2 0/2] char: tpm: add new driver for tpm i2c ptp

2019-07-18 Thread Alexander Steffen
On 18.07.2019 14:51, eyal.co...@nuvoton.com wrote: Hi Jarkko and Alexander, We have made an additional code review on the TPM TIS core driver, it looks quite good and we can connect our new I2C driver to this layer. Great :) In the meantime, I've done some experiments creating an I2C driver

Re: [PATCH v11 00/16] Remove nested TPM operations

2019-02-07 Thread Alexander Steffen
On 06.02.2019 13:06, Jarkko Sakkinen wrote: On Wed, Feb 06, 2019 at 12:47:07AM +0200, Jarkko Sakkinen wrote: Make the changes necessary to detach TPM space code and TPM activation code out of the tpm_transmit() flow because of both of these can cause nested tpm_transmit() calls. The nesteds call

Re: [PATCH v11 00/16] Remove nested TPM operations

2019-02-08 Thread Alexander Steffen
On 08.02.2019 03:14, Stefan Berger wrote: On 2/7/19 8:51 PM, Stefan Berger wrote: On 2/7/19 7:33 PM, Jarkko Sakkinen wrote: On Thu, Feb 07, 2019 at 06:29:43PM -0500, Stefan Berger wrote: On 2/7/19 4:29 PM, Jarkko Sakkinen wrote: diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm

Re: [PATCH v11 00/16] Remove nested TPM operations

2019-02-08 Thread Alexander Steffen
On 08.02.2019 15:09, Jarkko Sakkinen wrote: On Fri, Feb 08, 2019 at 02:28:50PM +0100, Alexander Steffen wrote: Applying those changes fixes all the issues I saw, thanks. I'll retest Jarkko's tree without custom patches, once you've agreed on the rc question. Just send a two

Re: [PATCH v2 0/2] char: tpm: add new driver for tpm i2c ptp

2019-07-30 Thread Alexander Steffen
Hi Benoit, good to see you're still around. On 30.07.2019 10:39, Benoit HOUYERE wrote: Hi Alexander, Jarkko and Eyal, A first I2C TCG patch (tpm_tis_i2c.c) has been proposed in the same time as tpm_tis_spi.c by Christophe 3 years ago. https://patchwork.kernel.org/patch/8628681/ Thanks for

Re: [PATCH v2 0/2] char: tpm: add new driver for tpm i2c ptp

2019-07-04 Thread Alexander Steffen
On 04.07.2019 10:43, Jarkko Sakkinen wrote: Check out tpm_tis_core.c and tpm_tis_spi.c. TPM TIS driver implements that spec so you should only implement a new physical layer. I had the same thought. Unfortunately, the I2C-TIS specification introduces two relevant changes compared to tpm_tis/tp

Re: [PATCH v2 5/6] tpm: add driver for cr50 on SPI

2019-07-19 Thread Alexander Steffen
On 18.07.2019 20:07, Stephen Boyd wrote: Quoting Alexander Steffen (2019-07-18 09:47:14) On 17.07.2019 21:57, Stephen Boyd wrote: I think the idea is to let users override the quality if they decide that they don't want to use the default value specified in the driver. But isn&#

Re: [PATCH v2 5/6] tpm: add driver for cr50 on SPI

2019-07-19 Thread Alexander Steffen
On 18.07.2019 20:11, Stephen Boyd wrote: Quoting Alexander Steffen (2019-07-18 09:47:22) On 17.07.2019 23:38, Stephen Boyd wrote: Quoting Stephen Boyd (2019-07-17 12:57:34) Quoting Alexander Steffen (2019-07-17 05:00:06) Can't the code be shared more explicitly, e.g. by cr50_spi wra

[PATCH v3] tpm-dev-common: Reject too short writes

2017-09-08 Thread Alexander Steffen
: Alexander Steffen --- v2: - Moved all changes to tpm_common_write in a single patch. v3: - Access data copied from user space (priv->data_buffer) instead of user space data directly (buf). - Changed return code to EINVAL. drivers/char/tpm/tpm-dev-common.c | 6 ++ 1 file changed

[PATCH v4] tpm_tis_spi: Use DMA-safe memory for SPI transfers

2017-09-11 Thread Alexander Steffen
separately, to ensure that it is cacheline-aligned and not shared with other data, so that DMA can work correctly. Fixes: 0edbfea537d1 ("tpm/tpm_tis_spi: Add support for spi phy") Cc: sta...@vger.kernel.org Signed-off-by: Alexander Steffen --- v2: - Updated commit message with more explan

[PATCH RESEND v3 2/2] tpm_tis_spi: Use a single buffer for SPI transfers

2017-08-31 Thread Alexander Steffen
A single buffer is sufficient for both tx and rx, since bytes that have already been sent are not used anymore and can safely be overwritten with the received bytes. Signed-off-by: Alexander Steffen Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_tis_spi.c | 34

[PATCH RESEND v3 1/2] tpm_tis_spi: Use DMA-safe memory for SPI transfers

2017-08-31 Thread Alexander Steffen
separately, to ensure that it is cacheline-aligned and not shared with other data, so that DMA can work correctly. Fixes: 0edbfea537d1 ("tpm/tpm_tis_spi: Add support for spi phy") Cc: sta...@vger.kernel.org Signed-off-by: Alexander Steffen Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/tpm

[PATCH RESEND v3 0/2] tpm_tis_spi: Use DMA-safe memory

2017-08-31 Thread Alexander Steffen
for making the buffers DMA-safe and another for using only a single buffer. Alexander Steffen (2): tpm_tis_spi: Use DMA-safe memory for SPI transfers tpm_tis_spi: Use a single buffer for SPI transfers drivers/char/tpm/tpm_tis_spi.c | 32 ++-- 1 file changed, 18

[PATCH RESEND v2 0/3] tpm2-cmd: Improve self test execution

2017-08-31 Thread Alexander Steffen
The self test logic for TPM 2.0 was probably based on the implementation for TPM 1.2, but did not correctly take into account some TPM 2.0 specifics. This patch series fixes those issues. v2: - Moved implementation description from comment to commit message. Alexander Steffen (3): tpm2-cmd

[PATCH RESEND v2 1/3] tpm2-cmd: Trigger only missing self tests

2017-08-31 Thread Alexander Steffen
command. Signed-off-by: Alexander Steffen Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/tpm2-cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c index e1a41b7..8e940a5 100644 --- a/drivers/char/tpm/tpm2-cmd.c

[PATCH RESEND v2 3/3] tpm2-cmd: React correctly to RC_TESTING from self tests

2017-08-31 Thread Alexander Steffen
efficient unmarshalling, so it is difficult to execute this command. Therefore, we simply run the TPM2_SelfTest command in a loop, which should complete eventually, since we only request the execution of self tests that have not yet been done. Signed-off-by: Alexander Steffen Reviewed-by: Jarkko

[PATCH RESEND v2 2/3] tpm2-cmd: Use dynamic delay to wait for self test result

2017-08-31 Thread Alexander Steffen
In order to avoid delaying the code longer than necessary while still giving the TPM enough time to execute the self tests asynchronously, start with a small delay between two polls and increase it each round. Signed-off-by: Alexander Steffen Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm

[PATCH v2] tpm-dev-common: Reject too short writes

2017-09-04 Thread Alexander Steffen
: Alexander Steffen --- v2: - Moved all changes to tpm_common_write in a single patch. drivers/char/tpm/tpm-dev-common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm-dev-common.c b/drivers/char/tpm/tpm-dev-common.c index 610638a..ac25574 100644 --- a