All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: tpmdd-devel@lists.sourceforge.net,
	linux-security-module@vger.kernel.org,
	Peter Huewe <peterhuewe@gmx.de>,
	Marcel Selhorst <tpmdd@selhorst.net>,
	Christophe Ricard <christophe.ricard@gmail.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tpm: drop chip->is_open and chip->duration_adjusted
Date: Mon, 14 Nov 2016 21:11:54 -0800	[thread overview]
Message-ID: <20161115051106.u2xoduwf2kpcznv3@intel.com> (raw)
In-Reply-To: <20161115043001.GA22482@obsidianresearch.com>

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 use atomic bit ops for
> things that do not need to be atomic.. It makes the locking scheme
> less clear. is open is genuinely different since it relies on the
> atomic for correctness.

The way I see it is one of the status flags bound to chip among the
others. I do not see this cause too much harm for clarity. It eases
debugging the driver a bit because you get more state out of 'flags'.

It also makes code little a bit more robust as flags is independent of
locks.

How strong is your opposition here? I do not see any exceptional damage
done but see some subtle but still significant benefits.

> Merging is_duration makes lots of sense though

Also timeout_adjusted should be merged (for some reason missed it).

> Jason

/Jarkko

WARNING: multiple messages have this Message-ID (diff)
From: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Jason Gunthorpe
	<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc: Christophe Ricard
	<christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	open list <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] tpm: drop chip->is_open and chip->duration_adjusted
Date: Mon, 14 Nov 2016 21:11:54 -0800	[thread overview]
Message-ID: <20161115051106.u2xoduwf2kpcznv3@intel.com> (raw)
In-Reply-To: <20161115043001.GA22482-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

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 use atomic bit ops for
> things that do not need to be atomic.. It makes the locking scheme
> less clear. is open is genuinely different since it relies on the
> atomic for correctness.

The way I see it is one of the status flags bound to chip among the
others. I do not see this cause too much harm for clarity. It eases
debugging the driver a bit because you get more state out of 'flags'.

It also makes code little a bit more robust as flags is independent of
locks.

How strong is your opposition here? I do not see any exceptional damage
done but see some subtle but still significant benefits.

> Merging is_duration makes lots of sense though

Also timeout_adjusted should be merged (for some reason missed it).

> Jason

/Jarkko

------------------------------------------------------------------------------

  reply	other threads:[~2016-11-15  5:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-14 23:44 [PATCH] tpm: drop chip->is_open and chip->duration_adjusted Jarkko Sakkinen
2016-11-14 23:44 ` Jarkko Sakkinen
2016-11-15  4:30 ` Jason Gunthorpe
2016-11-15  5:11   ` Jarkko Sakkinen [this message]
2016-11-15  5:11     ` Jarkko Sakkinen
2016-11-16  5:28     ` Jason Gunthorpe
2016-11-16 22:54       ` Jarkko Sakkinen
2016-11-17 10:40 ` [tpmdd-devel] " Nayna
2016-11-17 10:40   ` Nayna
2016-11-17 17:36   ` [tpmdd-devel] " Jarkko Sakkinen
2016-11-17 17:36     ` 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=20161115051106.u2xoduwf2kpcznv3@intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=christophe.ricard@gmail.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@selhorst.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.