Re: [tpmdd-devel] [PATCH] tpm: drop chip->is_open and chip->duration_adjusted

2016-11-17 Thread Jarkko Sakkinen
On Thu, Nov 17, 2016 at 04:10:29PM +0530, Nayna wrote: > On 11/15/2016 05:14 AM, Jarkko Sakkinen wrote: > > - if (chip->flags & (TPM_CHIP_FLAG_TPM2 | TPM_CHIP_FLAG_VIRTUAL)) > > - return 0; > > + if (test_bit(TPM_CHIP_FLAG_TPM2, &chip->flags) || > > + test_bit(TPM_CHIP_FLAG_VIRT

Re: [tpmdd-devel] [PATCH] tpm: drop chip->is_open and chip->duration_adjusted

2016-11-17 Thread Nayna
On 11/15/2016 05:14 AM, Jarkko Sakkinen wrote: Use atomic bitops for chip->flags so that we do not need chip->is_open and chip->duration_adjusted anymore. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/st33zp24/st33zp24.c | 6 +++--- drivers/char/tpm/tpm-chip.c | 14 --

Re: [PATCH] tpm: drop chip->is_open and chip->duration_adjusted

2016-11-16 Thread Jarkko Sakkinen
On Tue, Nov 15, 2016 at 10:28:32PM -0700, Jason Gunthorpe wrote: > On Mon, Nov 14, 2016 at 09:11:54PM -0800, Jarkko Sakkinen wrote: > > > How strong is your opposition here? I do not see any exceptional damage > > done but see some subtle but still significant benefits. > > It seems OK, but I nev

Re: [PATCH] tpm: drop chip->is_open and chip->duration_adjusted

2016-11-15 Thread Jason Gunthorpe
On Mon, Nov 14, 2016 at 09:11:54PM -0800, Jarkko Sakkinen wrote: > How strong is your opposition here? I do not see any exceptional damage > done but see some subtle but still significant benefits. It seems OK, but I never like seeing locking made less clear - this should be manageable, and there

Re: [PATCH] tpm: drop chip->is_open and chip->duration_adjusted

2016-11-14 Thread Jarkko Sakkinen
On Mon, Nov 14, 2016 at 09:30:01PM -0700, Jason Gunthorpe wrote: > On Mon, Nov 14, 2016 at 03:44:58PM -0800, Jarkko Sakkinen wrote: > > Use atomic bitops for chip->flags so that we do not need chip->is_open > > and chip->duration_adjusted anymore. > > I don't know if it s a really great idea to us

Re: [PATCH] tpm: drop chip->is_open and chip->duration_adjusted

2016-11-14 Thread Jason Gunthorpe
On Mon, Nov 14, 2016 at 03:44:58PM -0800, Jarkko Sakkinen wrote: > Use atomic bitops for chip->flags so that we do not need chip->is_open > and chip->duration_adjusted anymore. I don't know if it s a really great idea to use atomic bit ops for things that do not need to be atomic.. It makes the lo

[PATCH] tpm: drop chip->is_open and chip->duration_adjusted

2016-11-14 Thread Jarkko Sakkinen
Use atomic bitops for chip->flags so that we do not need chip->is_open and chip->duration_adjusted anymore. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/st33zp24/st33zp24.c | 6 +++--- drivers/char/tpm/tpm-chip.c | 14 -- drivers/char/tpm/tpm-dev.c | 9 +++