All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Jason Gunthorpe
	<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	andrew zamansky
	<andrew.zamansky-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org>,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	gcwilson-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org,
	azamansk-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org,
	Dan.Morav-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org,
	stimpy1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH 1/2] tpm: Factor out common startup code
Date: Wed, 22 Jun 2016 15:22:28 +0300	[thread overview]
Message-ID: <20160622122227.GA27577@intel.com> (raw)
In-Reply-To: <20160620210757.GB11746-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

On Mon, Jun 20, 2016 at 03:07:57PM -0600, Jason Gunthorpe wrote:
> On Sun, Jun 19, 2016 at 02:39:24PM +0200, Jarkko Sakkinen wrote:
> > > Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> > > Tested-by: Andrew Zamansky <andrew.zamansky-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org>
> > 
> > Couldn't tpm?_auto_startup() be static functions inside tpm-chip.c?
> 
> Why? tpm-chip is for chip functions and tpm-interface is for command
> issuing functions, the startup command sequencors seem appropriately
> placed...
> 
> These are still module private functions.

Hmm.. interesting point and I actually realized that this related to
work that I'm doing right now.

I'm working on a patches to move TPM 1.x protocol level code to
tpm1-cmd.c. We want to do so that one can conditionally compile out TPM
1.x when it is not needed. Another reason is that, I would not like to
put TPM 1.x sealing code to tpm-interface.c.

Given that I think it is cool to keep these in tpm-interface.c in this
in tpm-interface.c.

Summary: lets keep it in a way that these functions are in
tpm-interface.c for now.

> > > +enum TPM_OPS_FLAGS {
> > > +	TPM_OPS_PROBE_TPM2 = BIT(0),
> > 
> > I see two alternatives here:
> > 
> > 1. Make this work for tpm_tis.c if it is doable.
> > 2. Remove this flag and call tpm2_probe() inside tpm_i2c_nuvoton.c.
> > 
> > If this flag works only for a single driver, it does not bring any value.
> 
> We already have two drivers that auto probe, you don't think there
> will be more? The idea is to try and remove these low level entry
> points so drivers are simpler.
> 
> TIS doesn't use it because it needs to get things setup in advance for
> interrupt auto-probing, which is a very TIS unique thing.
> 
> Alternatively we can drop the auto-probe from nuvoton and force it to
> rely on compatible string matching to enter TPM2 mode.

The patch set used TPM2_OPS_PROBE_TPM2 only for nuvoton driver. The more
recent one used it incorrectly with tpm_tis.

> Jason

PS. Would you have time to look at https://lkml.org/lkml/2016/6/17/887
and give your feedback? :)

/Jarkko

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape

  parent reply	other threads:[~2016-06-22 12:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-19  8:19 [PATCH 0/2] Add TPM 2.0 support to the Nuvoton i2c driver andrew zamansky
     [not found] ` <1466324401-5054-1-git-send-email-andrew.zamansky-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org>
2016-06-19  8:20   ` [PATCH 1/2] tpm: Factor out common startup code andrew zamansky
     [not found]     ` <1466324401-5054-2-git-send-email-andrew.zamansky-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org>
2016-06-19 12:39       ` Jarkko Sakkinen
     [not found]         ` <20160619123923.GA31053-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-20 21:07           ` Jason Gunthorpe
     [not found]             ` <20160620210757.GB11746-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-06-22 12:22               ` Jarkko Sakkinen [this message]
     [not found]                 ` <20160622122227.GA27577-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-22 21:37                   ` Jason Gunthorpe
2016-06-24 18:14                   ` Jason Gunthorpe
     [not found]                     ` <20160624181437.GB14506-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-06-24 20:17                       ` Jarkko Sakkinen
2016-06-25  7:07                       ` Andrew Zamansky
2016-06-19  8:20   ` [PATCH 2/2] tpm: Add TPM 2.0 support to the Nuvoton i2c driver (NPCT6xx family) andrew zamansky
     [not found]     ` <1466324401-5054-3-git-send-email-andrew.zamansky-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org>
2016-06-20 17:59       ` Rob Herring

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=20160622122227.GA27577@intel.com \
    --to=jarkko.sakkinen-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=Dan.Morav-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org \
    --cc=andrew.zamansky-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org \
    --cc=azamansk-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=gcwilson-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    --cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
    --cc=stimpy1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /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.