All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Laurent Bigonville <bigon@debian.org>
Cc: linux-integrity@vger.kernel.org,
	Lukasz Majczak <lma@semihalf.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
	Stefan Berger <stefanb@linux.ibm.com>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	Jerry Snitselaar <jsnitsel@redhat.com>
Subject: Re: [PATCH] tpm, tpm_tis: Acquire locality in tpm_tis_gen_interrupt() and tpm_get_timeouts()
Date: Mon, 14 Jun 2021 23:40:25 +0300	[thread overview]
Message-ID: <20210614204025.o46slg6qibdknqza@kernel.org> (raw)
In-Reply-To: <48721227-6518-779e-c6f2-692c4d7b5c92@debian.org>

On Thu, Jun 10, 2021 at 04:00:27PM +0200, Laurent Bigonville wrote:
> Le 10/06/21 à 14:29, Jarkko Sakkinen a écrit :
> > On Thu, Jun 10, 2021 at 01:35:47PM +0200, Laurent Bigonville wrote:
> > > # dmesg |grep -i tpm
> > > 
> > > [   13.019986] tpm_tis 00:06: 1.2 TPM (device-id 0x6871, rev-id 1)
> > > [   15.016198] tpm tpm0: tpm_try_transmit: send(): error -62
> > > [   15.016208] tpm tpm0: A TPM error (-62) occurred attempting to determine
> > > the timeouts
> > > [   15.016239] tpm_tis: probe of 00:06 failed with error -62
> > > [   15.053255] tpm_inf_pnp 00:06: Found TPM with ID IFX0102
> > If possible, can you check what happens when you apply the attached patch.
> > I'm not proposing it as a bug fix but it just simplifies the flow a lot,
> > and might help to observe something.
> > 
> With the patch on the top of HEAD of master and the patch from your branch,
> I'm getting this:
> 
> [   13.140548] tpm tpm0: invalid TPM_STS.x 0xa0, dumping stack for forensics
> [   13.140617] CPU: 4 PID: 462 Comm: systemd-udevd Tainted: G          I
> E     5.13.0-rc5+ #7
> [   13.140621] Hardware name: System manufacturer System Product Name/P6T
> DELUXE V2, BIOS 0406    04/24/2009
> [   13.140623] Call Trace:
> [   13.140628]  dump_stack+0x76/0x94
> [   13.140637]  tpm_tis_status.cold+0x19/0x20 [tpm_tis_core]
> [   13.140643]  tpm_transmit+0x15f/0x3d0 [tpm]
> [   13.140657]  tpm_transmit_cmd+0x25/0x90 [tpm]
> [   13.140666]  tpm2_probe+0xe2/0x140 [tpm]

It's weird because it's the first transaction with the TPM, not likely
to have any sort of mismatch in power gating.

I'm suspecting this:

	if (wait_startup(chip, 0) != 0) {
		rc = -ENODEV;
		goto out_err;
	}

I did not find anything from [*] stating that reading Access Register,
could cause any change in the burstCount (0xa0) but still might be worth
of testing to couple that with

	release_locality(chip, 0);

I.e. add that just after the first snippet.

[*] https://trustedcomputinggroup.org/resource/pc-client-platform-tpm-profile-ptp-specification/

/Jarkko

  reply	other threads:[~2021-06-14 20:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16  8:17 [PATCH] tpm, tpm_tis: Acquire locality in tpm_tis_gen_interrupt() and tpm_get_timeouts() Jarkko Sakkinen
2021-02-16  8:26 ` Paul Menzel
2021-02-16  8:39   ` Jarkko Sakkinen
2021-02-16  8:50     ` Paul Menzel
2021-02-16 16:14       ` Jarkko Sakkinen
2021-02-16 11:02 ` Laurent Bigonville
     [not found]   ` <CAFJ_xbo2Tvfjjbt-xFAkEAdqVEg0ZhDnGJa2qkJOYURx47hE+Q@mail.gmail.com>
2021-02-16 11:21     ` Laurent Bigonville
2021-02-16 14:09   ` Lukasz Majczak
2021-02-16 16:18     ` Jarkko Sakkinen
2021-02-16 16:16   ` Jarkko Sakkinen
2021-02-16 16:26     ` Jarkko Sakkinen
2021-02-16 16:34       ` Jarkko Sakkinen
2021-02-16 19:06         ` Laurent Bigonville
2021-02-17 11:51           ` Lukasz Majczak
2021-02-17 22:29           ` Jarkko Sakkinen
2021-06-01 21:17             ` Laurent Bigonville
2021-06-03  5:28               ` Jarkko Sakkinen
2021-06-03  9:42                 ` Laurent Bigonville
2021-06-09 12:43                   ` Jarkko Sakkinen
2021-06-10 11:35                     ` Laurent Bigonville
2021-06-10 12:29                       ` Jarkko Sakkinen
2021-06-10 14:00                         ` Laurent Bigonville
2021-06-14 20:40                           ` Jarkko Sakkinen [this message]
2021-06-15 11:19                             ` Laurent Bigonville
2021-06-15 12:56                               ` Jarkko Sakkinen
2021-06-15 16:27                                 ` Laurent Bigonville

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=20210614204025.o46slg6qibdknqza@kernel.org \
    --to=jarkko@kernel.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=bigon@debian.org \
    --cc=jgg@ziepe.ca \
    --cc=jsnitsel@redhat.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=lma@semihalf.com \
    --cc=peterhuewe@gmx.de \
    --cc=stefanb@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.