lkml.org 
[lkml]   [2019]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tpm_tis: turn on TPM before calling tpm_get_timeouts
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().

/Jarkko

\
 
 \ /
  Last update: 2019-11-15 18:44    [W:0.107 / U:5.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site