archive mirror
 help / color / mirror / Atom feed
From: Josh Zimmerman <>
To: Jason Gunthorpe
Subject: Re: [PATCH v5 2/2] Add "shutdown" to "struct class".
Date: Thu, 1 Jun 2017 09:55:20 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <20170601163905.GA2694-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/>

On Thu, Jun 1, 2017 at 9:39 AM, Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/> 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?

> 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
the lower-level functions after the tpm2_shutdown, the shutdown may
not be orderly. It is also a problem that register access could be
removed, though. I'm not sure what the best way to deal with this is
(I lack sufficient familiarity with the codebase). Do you have
thoughts on how to resolve this conflict?


Check out the vibrant tech community on one of the world's most
engaging tech sites,!

  parent reply	other threads:[~2017-06-01 16:55 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] ` <>
2017-06-01 16:39   ` Jason Gunthorpe
     [not found]     ` <20170601163905.GA2694-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/>
2017-06-01 16:55       ` Josh Zimmerman [this message]
     [not found]         ` <>
2017-06-01 17:04           ` Jason Gunthorpe
2017-06-16  8:57   ` Jarkko Sakkinen
     [not found]     ` <>
2017-06-16  9:14       ` Jarkko Sakkinen
     [not found]         ` <>
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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \
    --cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/ \
    --cc=jmorris-gx6/ \ \

* 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).