linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Eric Biederman <ebiederm@aristanetworks.com>,
	Stefan Achatz <stefan_achatz@web.de>,
	"Serge E. Hallyn" <serue@us.ibm.com>, Tejun Heo <tj@kernel.org>,
	Jiri Kosina <jkosina@suse.cz>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Benjamin Thery <benjamin.thery@bull.net>
Subject: Re: [PATCH 2/2] HID: roccat: using new sysfs_create_bin_group() in kone driver
Date: Sat, 13 Nov 2010 06:39:08 -0800	[thread overview]
Message-ID: <20101113143908.GA29750@suse.de> (raw)
In-Reply-To: <20101113060634.GB1919@core.coreip.homeip.net>

On Fri, Nov 12, 2010 at 10:06:34PM -0800, Dmitry Torokhov wrote:
> On Fri, Nov 12, 2010 at 04:52:32PM -0800, Greg KH wrote:
> > On Fri, Nov 12, 2010 at 04:21:45PM -0800, Eric Biederman wrote:
> > > On Fri, Nov 12, 2010 at 10:18 AM, Stefan Achatz <stefan_achatz@web.de> wrote:
> > > > hid-roccat-kone now uses new group functions for creating binary
> > > > sysfs attributes.
> > > 
> > > Looking at this, I have a problem with the way this works.
> > > You are still doing this the hard and racy way.
> > > 
> > > sysfs attributes that are only added when we initialize the hardware and
> > > are only removed when we remove the driver should use the device layer
> > > functions to create their attributes.
> > > 
> > > This achieves two things.  The code is easier to write because there
> > > is less of it.
> > > The notification to user space happens after the attributes appear so
> > > that you don't
> > > have strange hotplug races.
> > > 
> > > If there a chance you can look at implementing this in the simpler
> > > race free way?
> > 
> > Good point, just attach this attribute group to the device and the
> > driver core will automatically create the files for you.
> > 
> 
> Attribute group in device structure is normally owned and managed by
> subsystem core; without additional plumbing drivers should not be
> touching it, at least not normally.
> 
> Plus we do not have binary attribute group in device structure [yet].

In thinking about it a bit more, why do you have so many binary
attributes for this driver?  binary sysfs files are rare, so adding a
binary attribute group pointer to the device or driver would just waste
a lot of space that no one else uses.

What are these binary files for?  Who uses them?  I don't seem to be
able to find them in the Documentation/ABI directory, or am I missing
something here?

thanks,

greg k-h

  reply	other threads:[~2010-11-13 14:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1289585921.2629.13.camel@neuromancer>
2010-11-13  0:21 ` [PATCH 2/2] HID: roccat: using new sysfs_create_bin_group() in kone driver Eric Biederman
2010-11-13  0:52   ` Greg KH
2010-11-13  6:06     ` Dmitry Torokhov
2010-11-13 14:39       ` Greg KH [this message]
2010-11-13 16:34         ` Stefan Achatz
2010-11-14  0:03           ` Greg KH
2010-11-12 18:18 Stefan Achatz

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=20101113143908.GA29750@suse.de \
    --to=gregkh@suse.de \
    --cc=benjamin.thery@bull.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=ebiederm@aristanetworks.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=serue@us.ibm.com \
    --cc=stefan_achatz@web.de \
    --cc=tj@kernel.org \
    /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).