linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benoit HOUYERE <benoit.houyere@st.com>
To: Alexander Steffen <Alexander.Steffen@infineon.com>,
	"Eyal.Cohen@nuvoton.com" <Eyal.Cohen@nuvoton.com>,
	"jarkko.sakkinen@linux.intel.com"
	<jarkko.sakkinen@linux.intel.com>,
	"tmaimon77@gmail.com" <tmaimon77@gmail.com>
Cc: "oshrialkoby85@gmail.com" <oshrialkoby85@gmail.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"peterhuewe@gmx.de" <peterhuewe@gmx.de>,
	"jgg@ziepe.ca" <jgg@ziepe.ca>, "arnd@arndb.de" <arnd@arndb.de>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"oshri.alkoby@nuvoton.com" <oshri.alkoby@nuvoton.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-integrity@vger.kernel.org"
	<linux-integrity@vger.kernel.org>,
	"gcwilson@us.ibm.com" <gcwilson@us.ibm.com>,
	"kgoldman@us.ibm.com" <kgoldman@us.ibm.com>,
	"nayna@linux.vnet.ibm.com" <nayna@linux.vnet.ibm.com>,
	"Dan.Morav@nuvoton.com" <Dan.Morav@nuvoton.com>,
	"oren.tanami@nuvoton.com" <oren.tanami@nuvoton.com>,
	"Christophe Ricard (christophe.ricard@gmail.com)" 
	<christophe.ricard@gmail.com>, Elena WILLIS <elena.willis@st.com>,
	"Olivier COLLART" <olivier.collart@st.com>
Subject: RE: [PATCH v2 0/2] char: tpm: add new driver for tpm i2c ptp
Date: Fri, 6 Sep 2019 12:16:21 +0000	[thread overview]
Message-ID: <3f60b801f9684b939d93a4b900ff5d42@SFHDAG3NODE3.st.com> (raw)
In-Reply-To: <ef3e9f2f-9c8e-7cc1-dc4c-dc1833592238@infineon.com>

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@infineon.com> 
Sent: mardi 30 juillet 2019 19:42
To: Benoit HOUYERE <benoit.houyere@st.com>; Eyal.Cohen@nuvoton.com; jarkko.sakkinen@linux.intel.com; tmaimon77@gmail.com
Cc: oshrialkoby85@gmail.com; robh+dt@kernel.org; mark.rutland@arm.com; peterhuewe@gmx.de; jgg@ziepe.ca; arnd@arndb.de; gregkh@linuxfoundation.org; oshri.alkoby@nuvoton.com; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-integrity@vger.kernel.org; gcwilson@us.ibm.com; kgoldman@us.ibm.com; nayna@linux.vnet.ibm.com; Dan.Morav@nuvoton.com; oren.tanami@nuvoton.com; Christophe Ricard (christophe.ricard@gmail.com) <christophe.ricard@gmail.com>; Elena WILLIS <elena.willis@st.com>; Olivier COLLART <olivier.collart@st.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

  reply	other threads:[~2019-09-06 12:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28 15:13 [PATCH v2 0/2] char: tpm: add new driver for tpm i2c ptp Oshri Alkoby
2019-06-28 15:13 ` [PATCH v2 1/2] dt-bindings: tpm: add the TPM I2C PTP device tree binding documentation Oshri Alkoby
2019-06-28 15:13 ` [PATCH v2 2/2] char: tpm: add new driver for tpm i2c ptp Oshri Alkoby
2019-07-04  8:43 ` [PATCH v2 0/2] " Jarkko Sakkinen
2019-07-04 11:29   ` Alexander Steffen
2019-07-05 11:15     ` Jarkko Sakkinen
     [not found]     ` <CAM9mBwJC2QD5-gV1eJUDzC2Fnnugr-oCZCoaH2sT_7ktFDkS-Q@mail.gmail.com>
2019-07-05 11:28       ` Jarkko Sakkinen
     [not found]         ` <6e7ff1b958d84f6e8e585fd3273ef295@NTILML02.nuvoton.com>
     [not found]           ` <CAP6Zq1hPo9dG71YFyr7z9rjmi-DvoUZJOme4+2uqsfO+7nH+HQ@mail.gmail.com>
2019-07-15  9:45             ` Jarkko Sakkinen
2019-07-18 12:51               ` Eyal.Cohen
2019-07-18 17:10                 ` Alexander Steffen
2019-07-30  8:39                   ` Benoit HOUYERE
2019-07-30 17:42                     ` Alexander Steffen
2019-09-06 12:16                       ` Benoit HOUYERE [this message]
2019-08-15 17:03                   ` Oshri Alkobi
2019-08-16 16:12                     ` Alexander Steffen
2019-08-25 11:25                       ` Oshri Alkobi
2019-07-17  7:48             ` Alexander Steffen

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=3f60b801f9684b939d93a4b900ff5d42@SFHDAG3NODE3.st.com \
    --to=benoit.houyere@st.com \
    --cc=Alexander.Steffen@infineon.com \
    --cc=Dan.Morav@nuvoton.com \
    --cc=Eyal.Cohen@nuvoton.com \
    --cc=arnd@arndb.de \
    --cc=christophe.ricard@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=elena.willis@st.com \
    --cc=gcwilson@us.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jgg@ziepe.ca \
    --cc=kgoldman@us.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=nayna@linux.vnet.ibm.com \
    --cc=olivier.collart@st.com \
    --cc=oren.tanami@nuvoton.com \
    --cc=oshri.alkoby@nuvoton.com \
    --cc=oshrialkoby85@gmail.com \
    --cc=peterhuewe@gmx.de \
    --cc=robh+dt@kernel.org \
    --cc=tmaimon77@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).