From: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
To: Michal Nazarewicz <mina86@mina86.com>,
Alan Stern <stern@rowland.harvard.edu>
Cc: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>,
Tony Lindgren <tony@atomide.com>,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
Felipe Balbi <felipe.balbi@linux.intel.com>,
Bin Liu <b-liu@ti.com>,
pali.rohar@gmail.com
Subject: Re: [PATCH] usb: f_mass_storage: test whether thread is running before starting another
Date: Mon, 18 Apr 2016 11:26:42 +0200 [thread overview]
Message-ID: <5714A852.2040705@samsung.com> (raw)
In-Reply-To: <xa1tshyxgyng.fsf@mina86.com>
Hi Michał,
W dniu 07.04.2016 o 18:40, Michal Nazarewicz pisze:
>> On Thu, 7 Apr 2016, Michal Nazarewicz wrote:
>>> This makes me suspect it’s not possible to link a function instance to
>>> the same configuration twice, but now that I think about it, I’m not
>>> quite sure what would happen if one did:
>>>
>>> ln -s functions/mass_storage.0 configs/c.1/foo
>>> ln -s functions/mass_storage.0 configs/c.1/bar
>
> On Thu, Apr 07 2016, Alan Stern wrote:
>> Do you think it would be worthwhile to check for this possibility in
>> the driver and report an error?
>
> I think this should be (if it isn’t already) blocked on configfs side.
> I cannot see a legitimate use of such configuration and I wouldn’t be
> surprised if other function drivers broke as well.
>
Sorry about late response.
The function responsible for verifying if a symlink can be made is
in drivers/usb/gadget/configfs.c: config_usb_cfg_link()
There is a comment from the author:
/*
* Make sure this function is from within our _this_ gadget and not
* from another gadget or a random directory.
* Also a function instance can only be linked once.
*/
This is the code fragment of interest:
list_for_each_entry(f, &cfg->func_list, list) {
if (f->fi == fi) {
ret = -EEXIST;
goto out;
}
}
AP
next prev parent reply other threads:[~2016-04-18 9:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-05 17:28 [PATCH] usb: f_mass_storage: test whether thread is running before starting another Michal Nazarewicz
2016-04-05 17:42 ` Alan Stern
2016-04-05 18:07 ` Michal Nazarewicz
2016-04-05 18:35 ` Alan Stern
2016-04-05 22:26 ` Michal Nazarewicz
2016-04-06 15:05 ` Alan Stern
2016-04-07 9:57 ` Michal Nazarewicz
2016-04-07 14:25 ` Alan Stern
2016-04-07 14:46 ` Ivaylo Dimitrov
2016-04-07 20:50 ` Ivaylo Dimitrov
2016-04-07 16:40 ` Michal Nazarewicz
2016-04-18 9:26 ` Andrzej Pietrasiewicz [this message]
2016-04-19 14:38 ` Michal Nazarewicz
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=5714A852.2040705@samsung.com \
--to=andrzej.p@samsung.com \
--cc=b-liu@ti.com \
--cc=felipe.balbi@linux.intel.com \
--cc=ivo.g.dimitrov.75@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mina86@mina86.com \
--cc=pali.rohar@gmail.com \
--cc=stern@rowland.harvard.edu \
--cc=tony@atomide.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