All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jerry Snitselaar <jsnitsel@redhat.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: Sat, 16 Nov 2019 00:40:25 +0200	[thread overview]
Message-ID: <20191115224025.GA29389@linux.intel.com> (raw)
In-Reply-To: <20191115183621.GD4055@ziepe.ca>

On Fri, Nov 15, 2019 at 02:36:21PM -0400, Jason Gunthorpe wrote:
> On Fri, Nov 15, 2019 at 07:43:29PM +0200, Jarkko Sakkinen wrote:
> > On Thu, Nov 14, 2019 at 12:56:29PM -0400, Jason Gunthorpe wrote:
> > > On Thu, Nov 14, 2019 at 06:55:06PM +0200, Jarkko Sakkinen wrote:
> > > > > Would it function with the timeout values set at the beginning of
> > > > > tpm_tis_core_init (max values)?
> > > > 
> > > > tpm_get_timeouts() should be replaced with:
> > > > 
> > > > if (tpm_chip_start()) {
> > > > 	dev_err(dev, "Could not get TPM timeouts and durations\n");
> > > > 	rc = -ENODEV;
> > > > 	goto out_err;
> > > > }
> > > > 
> > > > tpm_stop_chip(chip);
> > > > 
> > > > tpm_get_timeouts() is called by tpm_auto_startup(). Also the function
> > > > should be moved to tpm_chip.c and converted to a static function so
> > > > that it won't be called from random cal sites like above.
> > > 
> > > Careful, the design here was to allow a driver to do only
> > > get_timeouts, then additional setup work, then do auto_startup()
> > > 
> > > Forcing a driver to do auto_startup too early may not be good.
> > 
> > All drivers always do it anyway because all drivers always call
> > tpm_chip_register().
> 
> But chip_register is after the driver has done it's setup and after it
> may have called get_timeouts
> 
> auto_setup should not be moved to before chip_register()

I do not see any sense calling from get_timeouts() from call sites
in the same initialization flow.

/Jarkko

  reply	other threads:[~2019-11-15 22:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-11 23:34 [PATCH] tpm_tis: turn on TPM before calling tpm_get_timeouts 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
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 [this message]
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=20191115224025.GA29389@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=christianbundy@fraction.io \
    --cc=jgg@ziepe.ca \
    --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 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.