Re: [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-14 Thread Jarkko Sakkinen
On Sat, Feb 13, 2016 at 11:57:24PM -0700, Jason Gunthorpe wrote: > On Sun, Feb 14, 2016 at 07:24:14AM +0200, Jarkko Sakkinen wrote: > > > This should take care of it for all drivers including vtpm. > > > > > > https://github.com/jgunthorpe/linux/commits/for-jarkko > > > > > > At the very least

Re: [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-14 Thread Jarkko Sakkinen
On Sat, Feb 13, 2016 at 11:57:24PM -0700, Jason Gunthorpe wrote: > On Sun, Feb 14, 2016 at 07:24:14AM +0200, Jarkko Sakkinen wrote: > > > This should take care of it for all drivers including vtpm. > > > > > > https://github.com/jgunthorpe/linux/commits/for-jarkko > > > > > > At the very least

Re: [tpmdd-devel] [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-13 Thread Jason Gunthorpe
On Sat, Feb 13, 2016 at 10:39:11AM -0500, Stefan Berger wrote: > >@@ -347,8 +347,8 @@ static int i2c_nuvoton_recv(struct tpm_chip *chip, u8 > >*buf, size_t count) > > */ > > static int i2c_nuvoton_send(struct tpm_chip *chip, u8 *buf, size_t len) > > { > >-struct device *dev = chip->pdev;

Re: [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-13 Thread Jason Gunthorpe
On Sun, Feb 14, 2016 at 07:24:14AM +0200, Jarkko Sakkinen wrote: > > This should take care of it for all drivers including vtpm. > > > > https://github.com/jgunthorpe/linux/commits/for-jarkko > > > > At the very least this turns silent use after free into a null pointer > > oops. > > > > We

Re: [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-13 Thread Jarkko Sakkinen
On Fri, Feb 12, 2016 at 08:33:20PM -0700, Jason Gunthorpe wrote: > On Fri, Feb 12, 2016 at 08:31:21PM -0500, Stefan Berger wrote: > > > I'll send you something else that might work for vtpm...' > > > > The vtpm driver will introduce chip->priv, which will point to vtpm_dev. For > > this reason we

Re: [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-13 Thread Jarkko Sakkinen
On Fri, Feb 12, 2016 at 05:04:30PM -0700, Jason Gunthorpe wrote: > This is a hold over from before the struct device conversion. > > - All prints should be using >dev, which is the Linux > standard. This changes prints to use tpm0 as the device name, > not the PnP/etc ID. > - The few places

Re: [tpmdd-devel] [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-13 Thread Stefan Berger
On 02/12/2016 07:04 PM, Jason Gunthorpe wrote: This is a hold over from before the struct device conversion. - All prints should be using >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

Re: [tpmdd-devel] [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-13 Thread Stefan Berger
On 02/12/2016 07:04 PM, Jason Gunthorpe wrote: This is a hold over from before the struct device conversion. - All prints should be using >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

Re: [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-13 Thread Jarkko Sakkinen
On Fri, Feb 12, 2016 at 08:33:20PM -0700, Jason Gunthorpe wrote: > On Fri, Feb 12, 2016 at 08:31:21PM -0500, Stefan Berger wrote: > > > I'll send you something else that might work for vtpm...' > > > > The vtpm driver will introduce chip->priv, which will point to vtpm_dev. For > > this reason we

Re: [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-13 Thread Jason Gunthorpe
On Sun, Feb 14, 2016 at 07:24:14AM +0200, Jarkko Sakkinen wrote: > > This should take care of it for all drivers including vtpm. > > > > https://github.com/jgunthorpe/linux/commits/for-jarkko > > > > At the very least this turns silent use after free into a null pointer > > oops. > > > > We

Re: [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-13 Thread Jarkko Sakkinen
On Fri, Feb 12, 2016 at 05:04:30PM -0700, Jason Gunthorpe wrote: > This is a hold over from before the struct device conversion. > > - All prints should be using >dev, which is the Linux > standard. This changes prints to use tpm0 as the device name, > not the PnP/etc ID. > - The few places

Re: [tpmdd-devel] [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-13 Thread Jason Gunthorpe
On Sat, Feb 13, 2016 at 10:39:11AM -0500, Stefan Berger wrote: > >@@ -347,8 +347,8 @@ static int i2c_nuvoton_recv(struct tpm_chip *chip, u8 > >*buf, size_t count) > > */ > > static int i2c_nuvoton_send(struct tpm_chip *chip, u8 *buf, size_t len) > > { > >-struct device *dev = chip->pdev;

Re: [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-12 Thread Jason Gunthorpe
On Fri, Feb 12, 2016 at 08:31:21PM -0500, Stefan Berger wrote: > > I'll send you something else that might work for vtpm...' > > The vtpm driver will introduce chip->priv, which will point to vtpm_dev. For > this reason we need to hold a reference to the vtpm_dev->dev in the > front end. This

Re: [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-12 Thread Jason Gunthorpe
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

Re: [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-12 Thread Jason Gunthorpe
On Fri, Feb 12, 2016 at 07:37:10PM -0500, Stefan Berger wrote: >Jason Gunthorpe 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 >dev, which is the Linux >> standard. This changes

[PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-12 Thread Jason Gunthorpe
This is a hold over from before the struct device conversion. - All prints should be using >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

Re: [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-12 Thread Jason Gunthorpe
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

Re: [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-12 Thread Jason Gunthorpe
On Fri, Feb 12, 2016 at 07:37:10PM -0500, Stefan Berger wrote: >Jason Gunthorpe 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 >dev, which is the

[PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-12 Thread Jason Gunthorpe
This is a hold over from before the struct device conversion. - All prints should be using >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

Re: [PATCH 2/3] tpm: Get rid of chip->pdev

2016-02-12 Thread Jason Gunthorpe
On Fri, Feb 12, 2016 at 08:31:21PM -0500, Stefan Berger wrote: > > I'll send you something else that might work for vtpm...' > > The vtpm driver will introduce chip->priv, which will point to vtpm_dev. For > this reason we need to hold a reference to the vtpm_dev->dev in the > front end. This