lkml.org 
[lkml]   [2014]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [tpmdd-devel] [PATCH v1 12/12] tpm: TPM2 sysfs attributes
    On 09/24/2014 01:13 PM, Jason Gunthorpe wrote:
    > On Wed, Sep 24, 2014 at 12:06:02PM +0300, Jarkko Sakkinen wrote:
    >> +static ssize_t durations_show(struct device *dev, struct device_attribute *attr,
    >> + char *buf)
    >> +{
    >> + struct tpm_chip *chip = dev_get_drvdata(dev);
    >> +
    >> + if (chip->vendor.duration[TPM_LONG] == 0)
    >> + return 0;
    >> +
    >> + return sprintf(buf, "%d %d %d [%s]\n",
    >> + jiffies_to_usecs(chip->vendor.duration[TPM_SHORT]),
    >> + jiffies_to_usecs(chip->vendor.duration[TPM_MEDIUM]),
    >> + jiffies_to_usecs(chip->vendor.duration[TPM_LONG]),
    >> + chip->vendor.duration_adjusted
    >> + ? "adjusted" : "original");
    >> +}
    >> +static DEVICE_ATTR_RO(durations);
    > Seem useless since the durations are constant, drop it?

    We show them for TPM 1.2 as well, so I'd keep them fo TPM2.

    >
    >> +static ssize_t timeouts_show(struct device *dev, struct device_attribute *attr,
    >> + char *buf)
    >> +{
    >> + struct tpm_chip *chip = dev_get_drvdata(dev);
    >> +
    >> + return sprintf(buf, "%d %d %d %d [%s]\n",
    >> + jiffies_to_usecs(chip->vendor.timeout_a),
    >> + jiffies_to_usecs(chip->vendor.timeout_b),
    >> + jiffies_to_usecs(chip->vendor.timeout_c),
    >> + jiffies_to_usecs(chip->vendor.timeout_d),
    >> + chip->vendor.timeout_adjusted
    >> + ? "adjusted" : "original");
    >> +}
    >> +static DEVICE_ATTR_RO(timeouts);

    With all the problems we had with TPM 1.2 TPM's wrong timeouts and
    showing them in sysfs, why not show them for TPM2 as well?



    \
     
     \ /
      Last update: 2014-09-24 20:01    [W:3.097 / U:0.284 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site