mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Jerry Snitselaar <jsnitsel@redhat.com>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	linux-integrity <linux-integrity@vger.kernel.org>,
	Peter Huewe <peterhuewe@gmx.de>,
	Linux List Kernel Mailing <linux-kernel@vger.kernel.org>,
	linux-stable@vger.kernel.org,
	Christian Bundy <christianbundy@fraction.io>
Subject: Re: [PATCH] tpm_tis: turn on TPM before calling tpm_get_timeouts
Date: Tue, 12 Nov 2019 16:26:23 -0400	[thread overview]
Message-ID: <20191112202623.GB5584@ziepe.ca> (raw)
In-Reply-To: <CALzcddtMiSzhgZv5R6xqb1Amyk7cdY4mJdYDS86KRxH4wR_EGA@mail.gmail.com>

On Tue, Nov 12, 2019 at 01:23:33PM -0700, Jerry Snitselaar wrote:
> On Tue, Nov 12, 2019 at 1:03 PM Jarkko Sakkinen
> <jarkko.sakkinen@linux.intel.com> wrote:
> >
> > On Mon, Nov 11, 2019 at 04:34:18PM -0700, Jerry Snitselaar wrote:
> > > With power gating moved out of the tpm_transmit code we need
> > > to power on the TPM prior to calling tpm_get_timeouts.
> > >
> > > Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > Cc: Peter Huewe <peterhuewe@gmx.de>
> > > Cc: Jason Gunthorpe <jgg@ziepe.ca>
> > > Cc: linux-kernel@vger.kernel.org
> > > Cc: linux-stable@vger.kernel.org
> > > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
> > > Reported-by: Christian Bundy <christianbundy@fraction.io>
> > > Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
> > >  drivers/char/tpm/tpm_tis_core.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
> > > index 270f43acbb77..cb101cec8f8b 100644
> > > +++ b/drivers/char/tpm/tpm_tis_core.c
> > > @@ -974,13 +974,14 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
> > >                * to make sure it works. May as well use that command to set the
> > >                * proper timeouts for the driver.
> > >                */
> > > +             tpm_chip_start(chip);
> > >               if (tpm_get_timeouts(chip)) {
> > >                       dev_err(dev, "Could not get TPM timeouts and durations\n");
> > >                       rc = -ENODEV;
> > > +                     tpm_stop_chip(chip);
> > >                       goto out_err;
> > >               }
> >
> > Couldn't this call just be removed?
> >
> > /Jarkko
> >
> 
> Probably. It will eventually get called when tpm_chip_register
> happens. I don't know what the reason was for trying it prior to the
> irq probe.

At least tis once needed the timeouts before registration because it
was issuing TPM commands to complete its setup.

If timeouts have not been set then no TPM command should be executed.

Jason

  reply	other threads:[~2019-11-12 20:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-11 23:34 Jerry Snitselaar
2019-11-12  0:03 ` [PATCH v2] " Jerry Snitselaar
2019-11-12 20:03 ` [PATCH] " Jarkko Sakkinen
2019-11-12 20:23   ` Jerry Snitselaar
2019-11-12 20:26     ` Jason Gunthorpe [this message]
2019-11-12 20:28       ` Jerry Snitselaar
2019-11-12 20:31         ` Jerry Snitselaar
2019-11-12 20:46           ` Jason Gunthorpe
2019-11-12 21:14             ` Jerry Snitselaar
2019-11-14 16:55         ` Jarkko Sakkinen
2019-11-14 16:56           ` Jason Gunthorpe
2019-11-15 17:43             ` Jarkko Sakkinen
2019-11-15 18:36               ` Jason Gunthorpe
2019-11-15 22:40                 ` Jarkko Sakkinen
2019-11-14 16:49       ` Jarkko Sakkinen
2019-11-14 16:51         ` Jason Gunthorpe
2019-11-13  0:02 ` [PATCH v3] " Jerry Snitselaar
2019-11-14 16:59   ` Jarkko Sakkinen

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=20191112202623.GB5584@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=christianbundy@fraction.io \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jsnitsel@redhat.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stable@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    /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

all inboxes | Powered by JetHome®