linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	Jason Gunthorpe <jgg@ziepe.ca>
Cc: linux-kernel@vger.kernel.org, Peter Huewe <peterhuewe@gmx.de>,
	linux-integrity@vger.kernel.org
Subject: Re: [PATCH v2] tpm: Add major_version sysfs file
Date: Tue, 29 Oct 2019 07:56:48 -0700	[thread overview]
Message-ID: <1572361008.4812.2.camel@HansenPartnership.com> (raw)
In-Reply-To: <20191029142225.GC7415@linux.intel.com>

On Tue, 2019-10-29 at 16:22 +0200, Jarkko Sakkinen wrote:
> On Tue, Oct 29, 2019 at 09:43:42AM -0300, Jason Gunthorpe wrote:
> > On Tue, Oct 29, 2019 at 11:17:31AM +0200, Jarkko Sakkinen wrote:
> > > On Mon, Oct 28, 2019 at 02:05:07PM -0700, Jerry Snitselaar wrote:
> > > > On Mon Oct 28 19, Jarkko Sakkinen wrote:
> > > > > On Fri, Oct 25, 2019 at 12:31:03PM -0700, Jerry Snitselaar
> > > > > wrote:
> > > > > > +	return sprintf(buf, "%s\n", chip->flags &
> > > > > > TPM_CHIP_FLAG_TPM2
> > > > > > +		       ? "2.0" : "1.2");
> > > > > 
> > > > > This is not right. Should be either "1" or "2".
> > > > > 
> > > > > /Jarkko
> > > > 
> > > > Okay I will fix that up. Do we have a final decision on the
> > > > file name,
> > > > major_version versus version_major?
> > > 
> > > Well, I don't see how major_version would make any sense. It is
> > > not as future proof as version_major. Still waiting for Jason's
> > > feedback for this.
> > 
> > $ find /sys/ -name  "*version*"
> > /sys/devices/pci0000:00/0000:00:17.0/ata1/host0/scsi_host/host0/ahc
> > i_host_version
> > /sys/devices/virtual/net/docker0/bridge/multicast_mld_version
> > /sys/devices/virtual/net/docker0/bridge/multicast_igmp_version
> > /sys/firmware/efi/esrt/entries/entry0/lowest_supported_fw_version
> > /sys/firmware/efi/esrt/entries/entry0/last_attempt_version
> > /sys/firmware/efi/esrt/entries/entry0/fw_version
> > /sys/module/acpi/parameters/acpica_version
> > 
> > etc..
> > 
> > Not a single example of the backward version.
> > 
> > Most likely it should be called 'tpm_version'
> 
> The postfix gives tells the part of the version number that the file
> reports. If you really want to add the prefix, then the appropriate
> name would be tpm_version_major.
> 
> I'd still go with just version_major as tpm_ prefix is somewhat
> redundant.

You have to be careful with overly generic names in sysfs ... this is
what happened to us in SCSI:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=42caa0edabd6a0a392ec36a5f0943924e4954311

That's not to say version_major is wrong ... plenty of sysfs files have
generic names like this, it's just that tpm_version_major might be more
future proof.

James



  reply	other threads:[~2019-10-29 14:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25 19:31 [PATCH v2] tpm: Add major_version sysfs file Jerry Snitselaar
2019-10-28 20:53 ` Jarkko Sakkinen
2019-10-28 21:05   ` Jerry Snitselaar
2019-10-29  9:17     ` Jarkko Sakkinen
2019-10-29 12:43       ` Jason Gunthorpe
2019-10-29 14:22         ` Jarkko Sakkinen
2019-10-29 14:56           ` James Bottomley [this message]
2019-10-29 15:22             ` Jason Gunthorpe
2019-10-29 19:11               ` Jerry Snitselaar
2019-10-31 21:04             ` 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=1572361008.4812.2.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).