All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Michal Nazarewicz <mina86@mina86.com>,
	Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	"'Kyungmin Park'" <kyungmin.park@samsung.com>,
	"'Felipe Balbi'" <balbi@ti.com>,
	"'Greg Kroah-Hartman'" <gregkh@linuxfoundation.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Joel Becker <jlbec@evilplan.org>
Subject: Re: [RFC][PATCH] fs: configfs: programmatically create config groups
Date: Fri, 14 Dec 2012 13:18:24 +0100	[thread overview]
Message-ID: <50CB1910.70502@linutronix.de> (raw)
In-Reply-To: <20121207231828.GM22789@localhost>

On 12/08/2012 12:18 AM, Joel Becker wrote:
> Hey Guys,

Hi Joel,

you took quite some time to write this down.

> 	Please remember that configfs is not a "user" interface, it's a
> userspace<->kernelspace interface.  Like sysfs, it's not required to be
> convenient for someone at a bash prompt.  My goal is that it is *usable*
> from a bash prompt.  So it must be that you can
> create/destroy/configure objects via mkdir/rmkdir/cat/echo, but you
> might have a lot of those mkdir/echo combos to configure something.
> When it comes to the "user" interface, a wrapper script or library
> should be converting a user intention into all that boilerplate.

It is good that you say such things so people that want this things know 
the reasons why it is not done.

>>>>> I think the question is of information flow direction.  If user gives
>>>>> some information to the kernel, she should be the one creating any
>>>>> necessary directories.  But if the information comes from kernel to the
>>>>> user, the kernel should create the structure.
>
> 	This last paragraph actually describes the distinction between
> configfs and sysfs.  More specifically, if userspace wants to create an
> object in the kernel, it should use configfs.  If the kernel has created
> an object on its own, it exposes it via sysfs.  It is a deliberate
> non-goal for configfs to replicate sysfs behavior.

So you are saying that I should expose my UDC hardware device via sysfs
after the hardware is available because the kernel created it.
How should I get then into configfs? mkdir a directory which is named
like the HW? This would be painful to do manually but as you said, we
should have a tool.

> [What About the Patch?]
>
> 	In general, attribute setting that turns into created configfs
> objects is against the theory of configfs.  In practice, it's a
> nightmare locking change.  Coming into this discussion, I though you
> were doing dymanic things at ->make_group() time, but that is already
> supported.
> 	But I want to hear your thoughts.  I've dumped a bunch of
> alternate approaches here.  Do any seem to fit?  What other challenges
> do you see?

I'm mostly fine with this. Part of the problem was/is that the user
could create lun1 without lun0. Now, after looking at target they don't
have this limitation so I don't think we should have it either. As nab
explained, lun0 is always handled implicit for certain requests and not
exposed as a lun if the user did not create it. So I think we can live
with this. After all we can still return with -EINVAL if the user
creates lun1 before lun0.

Now one little question remains: We plan to expose interface numbers
and endpoints. The current idea is to have one directory for each
endpoint something like endpointXX where XX is the endpoint number.
We create the gadget upfront and assign it later to the UDC via a
symlink. We learn the interface number after the gadget has been
assigned. I think you suggest that we create the directory via the tool
once we exposed its details via sysfs or so. This might be okay since we 
want it probably only for debugging. On the hand if we drop the
endpooint number we don't have this. Got to keep thinking about this.

Anyway, thank you for time and arguments pro / contra self-created
directories.

>
> Joel
>

Sebastian

  parent reply	other threads:[~2012-12-14 12:18 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26  8:35 [RFC][PATCH] fs: configfs: programmatically create config groups Andrzej Pietrasiewicz
2012-11-26  8:35 ` [RFC][PATCH] fs: configfs: allow other kernel parts to " Andrzej Pietrasiewicz
2012-11-26 13:14 ` [RFC][PATCH] fs: configfs: " Michal Nazarewicz
2012-11-26 16:30 ` Sebastian Andrzej Siewior
2012-11-26 16:56   ` Michal Nazarewicz
2012-11-26 17:06     ` Sebastian Andrzej Siewior
2012-11-26 17:54       ` Michal Nazarewicz
2012-11-27 15:20         ` Sebastian Andrzej Siewior
2012-11-28  7:08           ` Nicholas A. Bellinger
2012-11-27  8:57   ` Andrzej Pietrasiewicz
2012-11-27 14:32     ` Michal Nazarewicz
2012-11-27 15:59     ` Sebastian Andrzej Siewior
2012-11-27 16:23       ` Michal Nazarewicz
2012-11-28  8:15         ` Sebastian Andrzej Siewior
2012-11-28 13:05           ` Michal Nazarewicz
2012-11-28 13:50             ` Sebastian Andrzej Siewior
2012-11-28 14:24               ` Michal Nazarewicz
2012-11-28 18:52                 ` Sebastian Andrzej Siewior
2012-12-07 23:18               ` Joel Becker
2012-12-10 11:57                 ` Andrzej Pietrasiewicz
2012-12-10 14:17                   ` Andrzej Pietrasiewicz
2012-12-10 14:34                     ` Felipe Balbi
2012-12-10 15:27                       ` Andrzej Pietrasiewicz
2012-12-12  1:10                     ` Joel Becker
2012-12-11 21:27                   ` Joel Becker
2012-12-14 12:18                 ` Sebastian Andrzej Siewior [this message]
2012-11-28  8:10       ` Andrzej Pietrasiewicz
2012-11-28  8:38         ` Sebastian Andrzej Siewior
2012-11-28 14:09           ` Andrzej Pietrasiewicz

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=50CB1910.70502@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=andrzej.p@samsung.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jlbec@evilplan.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mina86@mina86.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.