From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Greg KH <greg@kroah.com>
Cc: Peter Huewe <peterhuewe@gmx.de>,
Ashley Lai <ashley@ashleylai.com>,
Marcel Selhorst <tpmdd@selhorst.net>,
tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
linux-api@vger.kernel.org, josh.triplett@intel.com,
christophe.ricard@gmail.com, will.c.arthur@intel.com,
monty.wiseman@intel.com
Subject: Re: [PATCH v3 4/6] tpm: TPM 2.0 sysfs attributes
Date: Thu, 16 Oct 2014 18:03:58 +0200 [thread overview]
Message-ID: <20141016160358.GB12979@intel.com> (raw)
In-Reply-To: <20141016093146.GA25070@kroah.com>
On Thu, Oct 16, 2014 at 11:31:46AM +0200, Greg KH wrote:
> On Wed, Oct 15, 2014 at 01:35:14PM +0200, Jarkko Sakkinen wrote:
> > +int tpm2_sysfs_add_device(struct tpm_chip *chip)
> > +{
> > + struct pcr_bank *pcr_bank;
> > + struct kobject *pcrs_kobj;
> > + struct device *dev = chip->dev;
> > + int rc;
> > +
> > + rc = sysfs_create_group(&chip->vendor.miscdev.this_device->kobj,
> > + &tpm_dev_group);
> > + if (rc) {
> > + dev_err(dev, "failed to create sysfs attributes, %d\n", rc);
> > + return rc;
> > + }
>
> You just raced and created sysfs files _after_ userspace saw that your
> device was enabled.
Here the options are limited because misc_register already spawns
KOBJ_ADD. Not much to do unless we would wipe the current use of
misc driver completely.
>
> > + pcrs_kobj = kobject_create_and_add("pcrs",
> > + &chip->vendor.miscdev.this_device->kobj);
>
> Ick, no no no no. Never create a kobject under a 'struct device'. You
> just lost all libudev support for any attribute you created under here,
> not good at all. Use a "real" device if you really want a sub-device,
> not a kobject.
Ack, will rework this.
> thanks,
>
> greg k-h
/Jarkko
next prev parent reply other threads:[~2014-10-16 16:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-15 11:35 [PATCH v3 0/6] TPM 2.0 support Jarkko Sakkinen
2014-10-15 11:35 ` [PATCH v3 1/6] tpm: merge duplicate transmit_cmd() functions Jarkko Sakkinen
2014-10-15 11:35 ` [PATCH v3 2/6] tpm: two-phase chip management functions Jarkko Sakkinen
2014-10-15 11:35 ` [PATCH v3 3/6] tpm: TPM 2.0 commands Jarkko Sakkinen
2014-10-15 11:35 ` [PATCH v3 4/6] tpm: TPM 2.0 sysfs attributes Jarkko Sakkinen
2014-10-16 9:31 ` Greg KH
2014-10-16 16:03 ` Jarkko Sakkinen [this message]
2014-10-19 21:09 ` Tomas Winkler
2014-10-20 10:45 ` Jarkko Sakkinen
2014-10-19 22:07 ` Andy Lutomirski
2014-10-20 10:35 ` Jarkko Sakkinen
2014-10-15 11:35 ` [PATCH v3 5/6] tpm: TPM 2.0 CRB Interface Jarkko Sakkinen
2014-10-15 11:35 ` [PATCH v3 6/6] tpm: TPM 2.0 FIFO Interface 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=20141016160358.GB12979@intel.com \
--to=jarkko.sakkinen@linux.intel.com \
--cc=ashley@ashleylai.com \
--cc=christophe.ricard@gmail.com \
--cc=greg@kroah.com \
--cc=josh.triplett@intel.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=monty.wiseman@intel.com \
--cc=peterhuewe@gmx.de \
--cc=tpmdd-devel@lists.sourceforge.net \
--cc=tpmdd@selhorst.net \
--cc=will.c.arthur@intel.com \
/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).