Re: [PATCH] tpm: fix crash in tpm_tis deinitialization

2016-04-13 Thread Jason Gunthorpe
On Wed, Apr 13, 2016 at 09:58:05AM +0300, Jarkko Sakkinen wrote: > > > It prevents everything including the kernel from issuing a command > > > > > > That lock is not used to exclude kernel access. Read lock is only taken > > for the user space device

Re: [PATCH] tpm: fix crash in tpm_tis deinitialization

2016-04-12 Thread Jarkko Sakkinen
On Wed, Apr 13, 2016 at 09:16:51AM +0300, Jarkko Sakkinen wrote: > On Tue, Apr 12, 2016 at 11:26:55AM -0600, Jason Gunthorpe wrote: > > On Tue, Apr 12, 2016 at 07:26:27AM +0300, Jarkko Sakkinen wrote: > > > > This needs to be after ops is fenced, something like this. > > > > > > I would appreciate

Re: [PATCH] tpm: fix crash in tpm_tis deinitialization

2016-04-12 Thread Jarkko Sakkinen
On Tue, Apr 12, 2016 at 11:26:55AM -0600, Jason Gunthorpe wrote: > On Tue, Apr 12, 2016 at 07:26:27AM +0300, Jarkko Sakkinen wrote: > > > This needs to be after ops is fenced, something like this. > > > > I would appreciate a supporting argument. > > > > I guess the argument here is that this wil

Re: [PATCH] tpm: fix crash in tpm_tis deinitialization

2016-04-12 Thread Jason Gunthorpe
On Tue, Apr 12, 2016 at 07:26:27AM +0300, Jarkko Sakkinen wrote: > > This needs to be after ops is fenced, something like this. > > I would appreciate a supporting argument. > > I guess the argument here is that this will prevent user space from > issuing TPM commands after the shutdown command h

Re: [PATCH] tpm: fix crash in tpm_tis deinitialization

2016-04-11 Thread Jarkko Sakkinen
On Mon, Apr 11, 2016 at 11:40:37AM -0600, Jason Gunthorpe wrote: > On Mon, Apr 11, 2016 at 07:05:20PM +0300, Jarkko Sakkinen wrote: > > rmmod crashes the driver because tpm_chip_unregister() already sets ops > > to NULL. This commit fixes the issue by moving tpm2_shutdown() to > > tpm_chip_unregist

Re: [PATCH] tpm: fix crash in tpm_tis deinitialization

2016-04-11 Thread Jason Gunthorpe
On Mon, Apr 11, 2016 at 07:05:20PM +0300, Jarkko Sakkinen wrote: > rmmod crashes the driver because tpm_chip_unregister() already sets ops > to NULL. This commit fixes the issue by moving tpm2_shutdown() to > tpm_chip_unregister(). This commit is also cleanup because it removes > duplicate code fro

[PATCH] tpm: fix crash in tpm_tis deinitialization

2016-04-11 Thread Jarkko Sakkinen
rmmod crashes the driver because tpm_chip_unregister() already sets ops to NULL. This commit fixes the issue by moving tpm2_shutdown() to tpm_chip_unregister(). This commit is also cleanup because it removes duplicate code from tpm_crb and tpm_tis to the core. Signed-off-by: Jarkko Sakkinen Fixes