From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750987AbcBMCA3 (ORCPT ); Fri, 12 Feb 2016 21:00:29 -0500 Received: from quartz.orcorp.ca ([184.70.90.242]:39950 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714AbcBMCA2 (ORCPT ); Fri, 12 Feb 2016 21:00:28 -0500 Date: Fri, 12 Feb 2016 19:00:25 -0700 From: Jason Gunthorpe To: Stefan Berger Cc: Jarkko Sakkinen , linux-kernel@vger.kernel.org, Peter Huewe , tpmdd-devel@lists.sourceforge.net Subject: Re: [PATCH 2/3] tpm: Get rid of chip->pdev Message-ID: <20160213020025.GA23530@obsidianresearch.com> References: <1455321871-28296-1-git-send-email-jgunthorpe@obsidianresearch.com> <1455321871-28296-3-git-send-email-jgunthorpe@obsidianresearch.com> <201602130037.u1D0bDEN029756@d01av04.pok.ibm.com> <20160213011130.GA2547@obsidianresearch.com> <201602130128.u1D1S2Xn006955@d01av05.pok.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201602130128.u1D1S2Xn006955@d01av05.pok.ibm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 12, 2016 at 08:31:21PM -0500, Stefan Berger wrote: > The vtpm driver will introduce chip->priv, which will point to > vtpm_dev. For Why not just use chip->vendor.priv? Aka TPM_VPRIV > this reason we need to hold a reference to the vtpm_dev->dev in the > front end. Yes, but all drivers are like this. Most will just kfree their priv immediately All sane Linux core subsystems guarentee that after their unregister returns the driver callbacks will be done and uncallable, it is a bug that tpm does not do this. > So we could optimize it: > > if (chip->priv) > get_device(chip->dev.parent); That doesn't address the race Jason