linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: tpmdd-devel@lists.sourceforge.net,
	Marcel Selhorst <tpmdd@selhorst.net>,
	linux-kernel@vger.kernel.org, Peter Huewe <peterhuewe@gmx.de>
Subject: Re: [PATCH] tpm: fix crash in tpm_tis
Date: Mon, 11 Apr 2016 11:41:24 +0300	[thread overview]
Message-ID: <20160411084124.GA11322@intel.com> (raw)
In-Reply-To: <65cbfbc2-d994-452d-851c-102831ea0837@email.android.com>

On Thu, Apr 07, 2016 at 07:36:54AM -0700, Jason Gunthorpe wrote:
>    I will have to look closer after the conference, but this does not look
>    right.
> 
>    I vaguely recall commenting on this before. Move the shutdown into the
>    core code to fix it.

This fix that I sent is not the right way to do it.

One example scenario:

1. TIS driver gets detached, which causes tpm_tis_remove() to be called.
2. Some in-kernel subsystem uses TPM, which should not be done since the
   hardware is already unitialized.
3. The devres subsystem sets ops to NULL.

Even though the fix is wrong I feel that it might put the rwsem into
question.

I'm just thinking that maybe there could be a release callback in
tpm_class_ops that could be called by tpm_del_char_device(). There can't
be clients for the chip at that point so no synchronization mechanism
is needed.

>    Jason

/Jarkko

  parent reply	other threads:[~2016-04-11  8:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07 12:56 [PATCH] tpm: fix crash in tpm_tis Jarkko Sakkinen
     [not found] ` <65cbfbc2-d994-452d-851c-102831ea0837@email.android.com>
2016-04-11  8:41   ` Jarkko Sakkinen [this message]
2016-04-11 11:18     ` 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=20160411084124.GA11322@intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@selhorst.net \
    /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).