[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3f60b801f9684b939d93a4b900ff5d42@SFHDAG3NODE3.st.com>
Date: Fri, 6 Sep 2019 12:16:21 +0000
From: Benoit HOUYERE <benoit.houyere@...com>
To: Alexander Steffen <Alexander.Steffen@...ineon.com>,
"Eyal.Cohen@...oton.com" <Eyal.Cohen@...oton.com>,
"jarkko.sakkinen@...ux.intel.com" <jarkko.sakkinen@...ux.intel.com>,
"tmaimon77@...il.com" <tmaimon77@...il.com>
CC: "oshrialkoby85@...il.com" <oshrialkoby85@...il.com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"mark.rutland@....com" <mark.rutland@....com>,
"peterhuewe@....de" <peterhuewe@....de>,
"jgg@...pe.ca" <jgg@...pe.ca>, "arnd@...db.de" <arnd@...db.de>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"oshri.alkoby@...oton.com" <oshri.alkoby@...oton.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>,
"gcwilson@...ibm.com" <gcwilson@...ibm.com>,
"kgoldman@...ibm.com" <kgoldman@...ibm.com>,
"nayna@...ux.vnet.ibm.com" <nayna@...ux.vnet.ibm.com>,
"Dan.Morav@...oton.com" <Dan.Morav@...oton.com>,
"oren.tanami@...oton.com" <oren.tanami@...oton.com>,
"Christophe Ricard (christophe.ricard@...il.com)"
<christophe.ricard@...il.com>, Elena WILLIS <elena.willis@...com>,
"Olivier COLLART" <olivier.collart@...com>
Subject: RE: [PATCH v2 0/2] char: tpm: add new driver for tpm i2c ptp
Hi Steffen,
We have performed test against your simple implementation. For basic test it was ok, however for stress test, your implementation does not take in account NACK and it failed.
In PTP document, in chapter7.2.2.1.2 (Register write with address NACK), it indicates : "it's a good practice to repeat the current cycle using the correct I2C device address".
In other implementation,
https://patchwork.kernel.org/patch/8628681/
tpm_tis_i2c_read_bytes and tpm_tis_i2c_write_bytes handle NACK with a for loop.
+ for (i = 0; i < TPM_RETRY && ret < 0; i++) {
+ tpm_tis_i2c_sleep_guard_time(phy, TPM_I2C_SEND);
+ ret = i2c_master_send(phy->client, &i2c_reg, 1);
+ mod_timer(&phy->guard_timer, phy->guard_time);
+ }
+
+ if (ret < 0)
+ goto exit;
+
+ ret = -1;
+ for (i = 0; i < TPM_RETRY && ret < 0; i++) {
+ tpm_tis_i2c_sleep_guard_time(phy, TPM_I2C_RECV);
+ ret = i2c_master_recv(phy->client, result, len * size);
+ mod_timer(&phy->guard_timer, phy->guard_time);
+ }
I think that we should implement it before to include tpm_tis_i2c.c officially.
Thanks in advance,
Best Regards,
Benoit
-----Original Message-----
From: Alexander Steffen <Alexander.Steffen@...ineon.com>
Sent: mardi 30 juillet 2019 19:42
To: Benoit HOUYERE <benoit.houyere@...com>; Eyal.Cohen@...oton.com; jarkko.sakkinen@...ux.intel.com; tmaimon77@...il.com
Cc: oshrialkoby85@...il.com; robh+dt@...nel.org; mark.rutland@....com; peterhuewe@....de; jgg@...pe.ca; arnd@...db.de; gregkh@...uxfoundation.org; oshri.alkoby@...oton.com; devicetree@...r.kernel.org; linux-kernel@...r.kernel.org; linux-integrity@...r.kernel.org; gcwilson@...ibm.com; kgoldman@...ibm.com; nayna@...ux.vnet.ibm.com; Dan.Morav@...oton.com; oren.tanami@...oton.com; Christophe Ricard (christophe.ricard@...il.com) <christophe.ricard@...il.com>; Elena WILLIS <elena.willis@...com>; Olivier COLLART <olivier.collart@...com>
Subject: Re: [PATCH v2 0/2] char: tpm: add new driver for tpm i2c ptp
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 mentioning this. I forgot it exists, since it was still on the old mailing list.
> At the time, we have had two concerns :
> 1) I2C TPM component number, in the market, compliant with new I2C TCG specification to validate new I2C driver.
> 2) Lots changing was already provided by tpm_tis_spi.c on 4.8.
>
> That's why Tpm_tis_i2c.c has been postponed.
>
> Tpm_tis_spi Linux driver is now robust, if we have several different I2C TPM solutions today to validate a tpm_tis_i2c driver, I 'm ready to contribute to it for validation (STmicro TPM) or propose a solution compatible on 5.1 linux driver if needed under timeframe proposed (second half of august).
Could you run your tests against the simple implementation that I posted a while ago (https://patchwork.kernel.org/cover/11049365/) and provide your feedback? Since it is already based on the current tpm_tis_core, it is probably easier to integrate necessary changes there.
By the way, has it gotten any easier in the meantime to get hold of your TPMs to use them for kernel tests?
Alexander
Powered by blists - more mailing lists