From: Greg KH <gregkh@linuxfoundation.org>
To: "Winkler, Tomas" <tomas.winkler@intel.com>
Cc: "arnd@arndb.de" <arnd@arndb.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Ovsyanikov, Natalia" <natalia.ovsyanikov@intel.com>
Subject: Re: [char-misc-next 2/3] mei: adding sysfs fw_status attribute
Date: Mon, 29 Jul 2013 15:38:05 -0700 [thread overview]
Message-ID: <20130729223805.GA9677@kroah.com> (raw)
In-Reply-To: <5B8DA87D05A7694D9FA63FD143655C1B1AE77A4E@HASMSX106.ger.corp.intel.com>
On Mon, Jul 29, 2013 at 10:27:06PM +0000, Winkler, Tomas wrote:
>
> >
> > > > >
> > > > >
> > > > > > >
> > > > > > > Just to make sure, is this what you're suggesting ?
> > > > > > >
> > > > > > > device->groups = mei_attr_groups
> > > > > > > mei_misc_device.parent = device; ret =
> > > > > > > misc_register(&mei_misc_device);
> > > > > >
> > > > > > Yes, that should work. If not, please let me know, the code
> > > > > > underwent some changes in 3.11-rc2.
> > > > >
> > > > > I don' t see the file being created.
> > > > > Not sure if the misc_register setup the parent sysfs as well.
> > > >
> > > > Oops, wait, the parent is already registered, that's not going to
> > > > work, you want to create the files for the device itself that you
> > > > are creating, so set the -
> > > > >groups field for that device.
> > > >
> > > > sorry about that.
> > >
> > > So is this okay to go as is?
> >
> > What is "this"?
>
> The intentions was to create the sysfs on a parent pci device, and
> these are already created .
You can't create attributes on a device you do not "own", that will be
racy and prone to cause big problems (your callback will not with the
"right" device usually, as your parent might not "be" a pci device in
the future...)
> The only reason I wanted do it here as this is true for any parent pci
> device we support currently that registers with mei.
>
> Either this code ode is still confusing because I'm doing something
> wrong here or your mind Is set on fixing this particular user space
> race issue.
Probably both...
Either way, you can't create sysfs files in a racy way, I'm going
through the whole kernel tree to clean them all up, I'm not going to add
new race conditions today that I need to fix up tomorrow, my patch count
is high enough as it is :)
thanks,
greg k-h
next prev parent reply other threads:[~2013-07-29 22:38 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-24 15:41 [char-misc-next 0/3] mei: export fw status register through sysfs Tomas Winkler
2013-07-24 15:41 ` [char-misc-next 1/3] mei me: add handler for me_hw_ops fw_status Tomas Winkler
2013-07-24 15:41 ` [char-misc-next 2/3] mei: adding sysfs fw_status attribute Tomas Winkler
2013-07-24 16:00 ` Greg KH
2013-07-24 16:20 ` Winkler, Tomas
2013-07-24 16:26 ` Greg KH
2013-07-24 18:04 ` Winkler, Tomas
2013-07-24 20:29 ` Greg KH
2013-07-28 8:48 ` Winkler, Tomas
2013-07-28 15:31 ` Greg KH
2013-07-29 22:27 ` Winkler, Tomas
2013-07-29 22:38 ` Greg KH [this message]
2013-07-29 23:08 ` Winkler, Tomas
2013-07-29 23:17 ` Greg KH
2013-08-01 7:21 ` Winkler, Tomas
2013-08-01 7:32 ` Greg KH
2013-07-24 15:41 ` [char-misc-next 3/3] mei: update ABI for fw_status register exported through sysfs Tomas Winkler
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=20130729223805.GA9677@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=natalia.ovsyanikov@intel.com \
--cc=tomas.winkler@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 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.