From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Josh Zimmerman <joshz-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
jmorris-gx6/JNMH7DfYtjvyW6yDsg@public.gmane.org
Subject: Re: [PATCH v5 2/2] Add "shutdown" to "struct class".
Date: Thu, 1 Jun 2017 11:04:41 -0600 [thread overview]
Message-ID: <20170601170441.GA6571@obsidianresearch.com> (raw)
In-Reply-To: <CAHSjozBfU0Lmp_SnA5GcmACWxG4E1NdEcb9v7gcs5CLREuRNUA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Thu, Jun 01, 2017 at 09:55:20AM -0700, Josh Zimmerman wrote:
> On Thu, Jun 1, 2017 at 9:39 AM, Jason Gunthorpe
> <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> wrote:
> > On Thu, Jun 01, 2017 at 09:33:43AM -0700, Josh Zimmerman wrote:
> >
> >> - if (dev->bus && dev->bus->shutdown) {
> >> + if (dev->class && dev->class->shutdown) {
> >> + if (initcall_debug)
> >> + dev_info(dev, "shutdown\n");
> >> + dev->class->shutdown(dev);
> >> + } else if (dev->bus && dev->bus->shutdown) {
> >> if (initcall_debug)
> >> dev_info(dev, "shutdown\n");
> >> dev->bus->shutdown(dev);
> >
> > Looking at this closer, now you definately have to change the TPM
> > patch to call through to the other shutdown methods. We can say
> > current TPM drivers have no driver->shutdown, but we cannot be sure
> > about the bus->shutdown, so may as well call both from tpm's
> > class->shutdown.
> Why can't we be sure? Could bus->shutdown methods be registered
> outside of the drivers/char/tpm/ tree?
Yes.
> > I would say this should be done after the tpm2_shutdown completes as
> > lower level shutdowns could remove register access.
>
> This doesn't necessarily work. The spec states that tpm2_shutdown
> must be the last command issued for an orderly shutdown, so if we
> call
After tpm2_shutdown is called ops must be null'd then we call down the
rest of the shutdown methods which can no longer issue TPM commands
due to ops being NULL.
Jason
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
next prev parent reply other threads:[~2017-06-01 17:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-01 16:33 [PATCH v5 2/2] Add "shutdown" to "struct class" Josh Zimmerman
[not found] ` <CAHSjozA+xfUM-NmbP7Kb5B=T+u6qaEFzMWeF6OxX2N7-xHLAVQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-01 16:39 ` Jason Gunthorpe
[not found] ` <20170601163905.GA2694-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-06-01 16:55 ` Josh Zimmerman
[not found] ` <CAHSjozBfU0Lmp_SnA5GcmACWxG4E1NdEcb9v7gcs5CLREuRNUA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-01 17:04 ` Jason Gunthorpe [this message]
2017-06-16 8:57 ` Jarkko Sakkinen
[not found] ` <20170616085747.c2wkkgsdjuyju6vm-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-06-16 9:14 ` Jarkko Sakkinen
[not found] ` <20170616091452.txun2l3zni2zz7ne-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-06-16 18:31 ` Josh Zimmerman via tpmdd-devel
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=20170601170441.GA6571@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=jmorris-gx6/JNMH7DfYtjvyW6yDsg@public.gmane.org \
--cc=joshz-hpIqsD4AKlfQT0dZR+AlfA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).