tpmdd-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: "Winkler, Tomas" <tomas.winkler-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org"
	<tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] tpm: don't destroy chip device prematurely
Date: Wed, 5 Oct 2016 20:07:48 -0600	[thread overview]
Message-ID: <20161006020748.GA17479@obsidianresearch.com> (raw)
In-Reply-To: <5B8DA87D05A7694D9FA63FD143655C1B542F561B-Jy8z56yoSI8MvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org>

On Thu, Oct 06, 2016 at 12:43:13AM +0000, Winkler, Tomas wrote:

> > You keep asserting that, but it just isn't true at all.
> 
> Okay, let's rephrase, that calling device_del before tpm_transmit is not sane when using runtime_pm.

Maybe, but I haven't heard an explanation from you why that is the case,
and I haven't found one on my own..

> > Sure, but that relationship only maters if something does a PM call on the
> > chip->dev, and AFAIK, nothing does that.
> > 
> > Do you know differently?
> 
> You've pasted that code in in the previous mail, parent is involved on device remove.

I pasted the code to show it didn't seem possible to hit it because
irq_safe should not be true for chip->dev. You never explained how
this code can run.

> > You pointed at something that isn't even run and said it is the source of the
> > problem.. You really need to set up here and explain exactly what is
> > happening.
> 
> Sorry, lost you here.

You haven't done a good job explaining the problem in detail beyond some general
blame toward PM.

> > > > Even if that pm_runtime_put is happening, why doesn't the
> > > >
> > > > +    pm_runtime_get_sync(chip->dev.parent);
> > > >
> > > > The runtime_pm patch adds to tpm_transmit take care of bringing the
> > > > device back?
> > >
> > > Unfortunately not because, because it gets out of sync and what is
> > > actually happening is that idle callback is called and device is put
> > > to idle between send and receive.
> > 
> > What? As far as I understand this PM stuff, I would call that a very serious bug.
> 
> Maybe, but then you have to find what a bug,  currently it looks
> like wrong usage of the device.

Yes, you actually have to find and explain the bug to fix it.

You still haven't explained at all why device_del on the child causes
pm_runtime_get_sync() on the parent to malfunction. There is certainly
seems to be nothing intrinsic about the PM core that would cause that.

*That* is the really critical bit of explanation that is missing.

Until you can provide it there is no reason to continue discussing.

> > If a PM transition during transmit_cmd causes the TPM to abort/fail command
> > execution then it *MUST* be prevented. Period.
> 
> Or, we can call device_del after tpm2_shutdown. 

What? You haven't even established root cause, how do you know this
bug won't manifest in other cases? It could very well be some kind of
generic race-bug triggered by the proximity of device_del and
pm_runtime_get_sync. Or a HW bug of some kind..

> I will send you the actual trace, anyhow I've respin the original
> version with go_idle and cmd_ready handlers, this is contra
> productive, the time is just not right.

I'm deeply skeptical about all your patches if you can't root-cause
identify why the existing implementation isn't working.

But, you can sort out with Jarkko what to do with crb.

As long at the rest of the drivers and the core subsystem are not
broken by the device_del change. Jarkko - can you confirm you will
drop that patch?

Jason

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

  parent reply	other threads:[~2016-10-06  2:07 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-02  7:39 [PATCH] tpm: don't destroy chip device prematurely Tomas Winkler
     [not found] ` <1475393971-12715-1-git-send-email-tomas.winkler-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-10-02 10:17   ` Jarkko Sakkinen
     [not found]     ` <20161002101755.GA25844-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-10-02 10:24       ` Jarkko Sakkinen
     [not found]         ` <20161002102455.GA27464-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-10-02 21:21           ` Jason Gunthorpe
     [not found]             ` <20161002212126.GA25872-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-03  7:05               ` Winkler, Tomas
     [not found]                 ` <5B8DA87D05A7694D9FA63FD143655C1B542F466B-Jy8z56yoSI8MvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2016-10-03  7:38                   ` Winkler, Tomas
     [not found]                     ` <5B8DA87D05A7694D9FA63FD143655C1B542F46C1-Jy8z56yoSI8MvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2016-10-03 12:42                       ` Jarkko Sakkinen
2016-10-03 16:03                         ` Jason Gunthorpe
     [not found]                           ` <20161003160308.GA6801-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-03 17:30                             ` Winkler, Tomas
2016-10-03 12:48                 ` Jarkko Sakkinen
     [not found]                   ` <20161003124836.GE9990-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-10-04  5:19                     ` Jarkko Sakkinen
2016-10-04 16:47                       ` Jason Gunthorpe
2016-10-04 21:55                         ` Winkler, Tomas
2016-10-04 23:10                           ` Jason Gunthorpe
     [not found]                             ` <20161004231057.GA20062-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-05  7:48                               ` Winkler, Tomas
     [not found]                                 ` <5B8DA87D05A7694D9FA63FD143655C1B542F5084-Jy8z56yoSI8MvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2016-10-05 15:15                                   ` Jarkko Sakkinen
2016-10-05 16:37                                     ` Jason Gunthorpe
2016-10-05 17:11                                 ` Jason Gunthorpe
2016-10-05 20:09                                   ` Winkler, Tomas
2016-10-05 21:16                                     ` Jason Gunthorpe
2016-10-06  0:43                                       ` Winkler, Tomas
     [not found]                                         ` <5B8DA87D05A7694D9FA63FD143655C1B542F561B-Jy8z56yoSI8MvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2016-10-06  2:07                                           ` Jason Gunthorpe [this message]
     [not found]                                             ` <20161006020748.GA17479-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-07 14:24                                               ` Winkler, Tomas
2016-10-07 19:17                                                 ` Jason Gunthorpe
     [not found]                                                   ` <20161007191724.GA28795-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-07 20:10                                                     ` Winkler, Tomas
     [not found]                                                 ` <5B8DA87D05A7694D9FA63FD143655C1B542F625A-Jy8z56yoSI8MvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2016-10-08 10:47                                                   ` Jarkko Sakkinen
2016-10-05 10:02                         ` Jarkko Sakkinen
     [not found]                           ` <20161005100234.GA20851-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-10-05 16:27                             ` Jason Gunthorpe
2016-10-06 11:23                               ` Jarkko Sakkinen
2016-10-06 16:22                                 ` Jason Gunthorpe
     [not found]                                   ` <20161006162245.GF1224-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-06 16:46                                     ` Jarkko Sakkinen
2016-10-05 10:09                         ` Jarkko Sakkinen
2016-10-03 16:00                 ` Jason Gunthorpe
2016-10-03 17:16                   ` Winkler, Tomas
     [not found]                     ` <5B8DA87D05A7694D9FA63FD143655C1B542F474C-Jy8z56yoSI8MvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2016-10-03 17:30                       ` Jason Gunthorpe

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=20161006020748.GA17479@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tomas.winkler-ral2JQCrhuEAvxtiuMwx3w@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).