linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Vinod Koul <vinod.koul@intel.com>
Cc: ALSA <alsa-devel@alsa-project.org>,
	Charles Keepax <ckeepax@opensource.cirrus.com>,
	Sudheer Papothi <spapothi@codeaurora.org>,
	Takashi <tiwai@suse.de>,
	plai@codeaurora.org, LKML <linux-kernel@vger.kernel.org>,
	Pierre <pierre-louis.bossart@linux.intel.com>,
	patches.audio@intel.com, Mark <broonie@kernel.org>,
	srinivas.kandagatla@linaro.org,
	Sagar Dharia <sdharia@codeaurora.org>,
	alan@linux.intel.com
Subject: Re: [alsa-devel] [PATCH v5 10/15] soundwire: Add sysfs for SoundWire DisCo properties
Date: Wed, 13 Dec 2017 17:59:22 +0100	[thread overview]
Message-ID: <20171213165922.GA6501@kroah.com> (raw)
In-Reply-To: <20171213165246.GQ18649@localhost>

On Wed, Dec 13, 2017 at 10:22:46PM +0530, Vinod Koul wrote:
> On Wed, Dec 13, 2017 at 05:28:21PM +0100, Greg Kroah-Hartman wrote:
> > On Wed, Dec 13, 2017 at 03:24:30PM +0530, Vinod Koul wrote:
> > > On Wed, Dec 13, 2017 at 10:15:37AM +0100, Greg Kroah-Hartman wrote:
> > > > On Wed, Dec 06, 2017 at 09:17:06PM +0530, Vinod Koul wrote:
> > > > > It helps to read the properties for understanding and debugging
> > > > > systems, so add sysfs files for SoundWire DisCo properties.
> > > > > 
> > > > > TODO: Add ABI files for sysfs
> > > > 
> > > > Is this TODO done?
> > > 
> > > Nope sorry not yet. But before this get merged will add
> > > 
> > > > > + * Base file is:
> > > > > + *		properties
> > > > > + *		|---- interface-revision
> > > > > + *		|---- master-count
> > > > > + *		|---- link-N
> > > > > + *		      |---- clock-stop-modes
> > > > > + *		      |---- max-clock-frequency
> > > > > + *		      |---- clock-frequencies
> > > > > + *		      |---- default-frame-rows
> > > > > + *		      |---- default-frame-cols
> > > > > + *		      |---- dynamic-frame-shape
> > > > > + *		      |---- command-error-threshold
> > > > > + */
> > > > 
> > > > Why nest them so deep?  Anyway, that's not really an issue I guess, it's
> > > > your ABI, not mine :)
> > > 
> > > well it gives us a hierarchical view. We have N links...
> > 
> > That's fine, then make it a real 'struct device' if you want to have a
> > reference counted object.  Tie it to your bus, and you are good to go.
> > Don't use a raw kobject as that totaly breaks the device heirachy in the
> > kernel as well as preventing any of these attributes from being accessed
> > by userspace libraries (i.e. libudev.)
> > 
> > > > > +
> > > > > +struct sdw_master_sysfs {
> > > > > +	struct kobject kobj;
> > > > > +	struct sdw_bus *bus;
> > > > 
> > > > Huh?  Why do you need to use kobjects?
> > > > 
> > > > When you switch from using a 'struct device' and hang a kobject off of
> > > > it, that's a huge signal that something is wrong here.  That kobject
> > > > will now no longer be part of the device "chain" in the system, uevents
> > > > will get odd, and other strange things can happen.
> > > > 
> > > > Why can't you just use "normal" attributes attached to the device?  You
> > > > shouldn't need a kobject here.  What am I missing?
> > > 
> > > Okay my understanding might be incorrect then. So we can have N links in
> > > the system and each link would have a kobject for "link-N". Not sure how
> > > device attributes would do link-N/clock-stop-modes and so on, if they can
> > > let me know how and I will surely change that.
> > 
> > You can create a subdirectory for attributes quite easily.  If you don't
> > want to make it a "full" object, and all you care about is the
> > subdirectory, then do it that way.  Otherwise use a 'struct device'
> > please.
> 
> Okay thanks this makes sense, yes all we do care about is creating
> subdirectories and attributes under them. So in that sense we don't care
> much about adding kobjects, it was means to the end.
> 
> So do you mind pointing an example, I though the way for that was kobjects
> by looking at few examples I saw.

Create a dynamic attribute group on the fly and initialize it and set
the name to the name you want for the subdirectory.  I know it's done in
the kernel in some places, dig around :)

good luck!

greg k-h

  reply	other threads:[~2017-12-13 16:59 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 15:46 [PATCH v5 00/15] soundwire: Add a new SoundWire subsystem Vinod Koul
2017-12-06 15:46 ` [PATCH v5 01/15] Documentation: Add SoundWire summary Vinod Koul
2017-12-06 15:46 ` [PATCH v5 02/15] soundwire: Add SoundWire bus type Vinod Koul
2017-12-13  9:16   ` Greg Kroah-Hartman
2017-12-06 15:46 ` [PATCH v5 03/15] soundwire: Add Master registration Vinod Koul
2017-12-11 16:02   ` Takashi Iwai
2017-12-11 16:44     ` [alsa-devel] " Vinod Koul
2017-12-13  9:16   ` Greg Kroah-Hartman
2017-12-06 15:47 ` [PATCH v5 04/15] soundwire: Add MIPI DisCo property helpers Vinod Koul
2017-12-11 16:10   ` Takashi Iwai
2017-12-11 17:00     ` Vinod Koul
2017-12-11 17:06       ` Takashi Iwai
2017-12-11 17:18         ` Vinod Koul
2017-12-06 15:47 ` [PATCH v5 05/15] soundwire: Add SoundWire MIPI defined registers Vinod Koul
2017-12-06 15:47 ` [PATCH v5 06/15] soundwire: Add IO transfer Vinod Koul
2017-12-06 15:47 ` [PATCH v5 07/15] regmap: Add SoundWire bus support Vinod Koul
2017-12-06 15:47 ` [PATCH v5 08/15] soundwire: Add Slave status handling helpers Vinod Koul
2017-12-06 15:47 ` [PATCH v5 09/15] soundwire: Add slave status handling Vinod Koul
2017-12-06 15:47 ` [PATCH v5 10/15] soundwire: Add sysfs for SoundWire DisCo properties Vinod Koul
2017-12-13  9:15   ` Greg Kroah-Hartman
2017-12-13  9:54     ` Vinod Koul
2017-12-13 14:31       ` Pierre-Louis Bossart
2017-12-13 16:28       ` Greg Kroah-Hartman
2017-12-13 16:52         ` [alsa-devel] " Vinod Koul
2017-12-13 16:59           ` Greg Kroah-Hartman [this message]
2017-12-22  8:26             ` Vinod Koul
2017-12-22  8:33               ` Greg Kroah-Hartman
2017-12-22 11:43                 ` Vinod Koul
2017-12-22 15:20                   ` Greg Kroah-Hartman
2017-12-06 15:47 ` [PATCH v5 11/15] soundwire: cdns: Add cadence library Vinod Koul
2017-12-06 15:47 ` [PATCH v5 12/15] soundwire: cdns: Add sdw_master_ops and IO transfer support Vinod Koul
2017-12-06 15:47 ` [PATCH v5 13/15] soundwire: intel: Add Intel Master driver Vinod Koul
2017-12-06 15:47 ` [PATCH v5 14/15] soundwire: intel: Add Intel init module Vinod Koul
2017-12-06 15:47 ` [PATCH v5 15/15] MAINTAINERS: Add SoundWire entry Vinod Koul
2017-12-06 20:44 ` [PATCH v5 00/15] soundwire: Add a new SoundWire subsystem Philippe Ombredanne
2017-12-07  0:38 ` Pierre-Louis Bossart
2017-12-11 16:30 ` Takashi Iwai
2017-12-13  9:18 ` Greg Kroah-Hartman
2017-12-13  9:57   ` Vinod Koul

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=20171213165922.GA6501@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=alan@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches.audio@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=plai@codeaurora.org \
    --cc=sdharia@codeaurora.org \
    --cc=spapothi@codeaurora.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@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).