tpmdd-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Stefan Berger <stefanb@us.ibm.com>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	linux-kernel@vger.kernel.org, Peter Huewe <peterhuewe@gmx.de>,
	tpmdd-devel@lists.sourceforge.net
Subject: Re: [PATCH 2/3] tpm: Get rid of chip->pdev
Date: Fri, 12 Feb 2016 18:11:30 -0700	[thread overview]
Message-ID: <20160213011130.GA2547@obsidianresearch.com> (raw)
In-Reply-To: <201602130037.u1D0bDEN029756@d01av04.pok.ibm.com>

On Fri, Feb 12, 2016 at 07:37:10PM -0500, Stefan Berger wrote:
>    Jason Gunthorpe <jgunthorpe@obsidianresearch.com> wrote on 02/12/2016
>    07:04:30 PM:
>    >
>    > This is a hold over from before the struct device conversion.
>    >
>    > - All prints should be using &chip->dev, which is the Linux
>    >   standard. This changes prints to use tpm0 as the device name,
>    >   not the PnP/etc ID.
>    > - The few places involving sysfs/modules that really do need the
>    >   parent just use chip->dev.parent instead
>    > - We no longer need to get_device(pdev) in any places since it is no
>    >   longer used by any of the code. The kref on the parent is held
>    >   by the device core during device_add and dropped in device_del
>    That is exactly what was needed for the vtpm driver and now you're
>    removing it. Is that still going to work after this change? Or do we
>    need to re-add it as get/put_device(chip->dev.parent) ?

That code was not correct, the get_device side has racy
lack-of-locking problems and it serves no purpose for the tpm core or
any existing driver.

I already fixed this once in commit ba0ef85479c46a 'tpm: Fix
initialization of the cdev' - that solves the racing of get_device,
and grabs the correct device kref, but I forgot to delete the broken
residual get_device. Sigh.

It is unfortunate that bogus code sent you down this rabbit hole. My
bad :(

I'll send you something else that might work for vtpm...

Jason

  parent reply	other threads:[~2016-02-13  1:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-13  0:04 [PATCH 0/3] Various struct device cleanups Jason Gunthorpe
     [not found] ` <1455321871-28296-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-02-13  0:04   ` [PATCH 1/3] tpm: Hold the kref during tpm_chip_find_get Jason Gunthorpe
     [not found]     ` <1455321871-28296-2-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-02-13 10:08       ` Jarkko Sakkinen
     [not found]         ` <20160213100818.GA12607-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-02-13 15:45           ` Jason Gunthorpe
2016-02-14  4:55       ` Jarkko Sakkinen
     [not found]         ` <20160214045512.GA7777-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-02-14  6:50           ` Jason Gunthorpe
2016-02-14  8:02             ` Jarkko Sakkinen
2016-02-13  0:04   ` [PATCH 2/3] tpm: Get rid of chip->pdev Jason Gunthorpe
     [not found]     ` <1455321871-28296-3-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-02-13  0:37       ` Stefan Berger
2016-02-13 15:39       ` Stefan Berger
     [not found]         ` <56BF4E1F.2030208-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2016-02-14  7:06           ` Jason Gunthorpe
2016-02-14  5:13       ` Jarkko Sakkinen
     [not found]     ` <201602130037.u1D0bDEN029756@d01av04.pok.ibm.com>
2016-02-13  1:11       ` Jason Gunthorpe [this message]
     [not found]         ` <20160213011130.GA2547-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-02-13  1:31           ` Stefan Berger
     [not found]         ` <201602130128.u1D1S2Xn006955@d01av05.pok.ibm.com>
     [not found]           ` <201602130128.u1D1S2Xn006955-8DuMPbUlb4HImUpY6SP3GEEOCMrvLtNR@public.gmane.org>
2016-02-13  2:00             ` Jason Gunthorpe
2016-02-13  3:33             ` Jason Gunthorpe
2016-02-14  5:24               ` Jarkko Sakkinen
     [not found]                 ` <20160214052414.GB8065-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-02-14  6:57                   ` Jason Gunthorpe
     [not found]                     ` <20160214065724.GD9551-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-02-14  8:03                       ` Jarkko Sakkinen
2016-02-13  0:04 ` [PATCH 3/3] tpm: Get rid of devname Jason Gunthorpe
     [not found]   ` <1455321871-28296-4-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-02-13  1:01     ` kbuild test robot
     [not found]       ` <201602130853.47ON3KAx%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-02-13  1:13         ` Jason Gunthorpe
2016-02-14  5:16     ` 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=20160213011130.GA2547@obsidianresearch.com \
    --to=jgunthorpe@obsidianresearch.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=stefanb@us.ibm.com \
    --cc=tpmdd-devel@lists.sourceforge.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).