Hi, On Tue, Jan 27, 2015 at 08:20:58PM +0100, Krzysztof Opasiak wrote: > > > > -----Original Message----- > > From: Felipe Balbi [mailto:balbi@xxxxxx] > > Sent: Tuesday, January 27, 2015 7:45 PM > > To: Krzysztof Opasiak > > Cc: balbi@xxxxxx; linux-usb@xxxxxxxxxxxxxxx; > > gregkh@xxxxxxxxxxxxxxxxxxx; bigeasy@xxxxxxxxxxxxx; > > s.wadas@xxxxxxxxxxx; k.lewandowsk@xxxxxxxxxxx; > > m.szyprowski@xxxxxxxxxxx; andrzej.p@xxxxxxxxxxx > > Subject: Re: [PATCH] usb: gadget: composite: Provide list of > > registered functions > > > > Hi, > > > > On Tue, Jan 27, 2015 at 06:24:42PM +0100, Krzysztof Opasiak wrote: > > > > > So I must have misunderstood something. > > > > > > > > > > I'm not sure if this is a good idea. > > > > > Some userspace depends on assumption that sys/kernel/config > > > > directory > > > > > is empty and it's default place for mounting configfs. > > > > > > > > and that's fine, they can certainly assume that. Once configfs > > is > > > > mounted, we will have a new /sys/kernel/config/usb-functions > > > > directory. > > > > > > > > Inside that directory we should have a file which contains your > > list > > > > of available functions :-) I don't see what the problem is with > > that > > > > :-s > > > > > > > > > > Please hold done I don't get it. Let's clarify. > > > > _________________________________________ > > / Hello! I'm a programmer cow who can \ > > | explain ConfigFS-related questions much | better than Felipe > > Balbi. > > | What we need | > > | in this case is just for the our USB | > > | Gadget ConfigFS port to create the file | > > | when that is mounted. Just have the | > > | file come with /usb_gadget. Not ProcFS, | not SysFS, but with > > ConfigFS > > | and we're | > > | good to go. Let me know if I can | > > \ explain anything further / > > ----------------------------------------- > > \ ^__^ > > \ (Oo)\_______ > > (__)\ )\/\ > > ||----w | > > || || > > > > > Would you like to register a separate usb-functions subsystem in > > > configfs only to expose there a list of available functions? As > > far as > > > I know it's the only way of creating anything in configfs root. > > > > > > So you would get: > > > > > > $ ls /sys/kernel/config > > > usb-gadget usb-functions > > > > > > > > > Or it is just a typo and you would like to place a usb-functions > > > attribute in usb-gadget directory? > > > In this option we will get: > > > > > > $ ls /sys/kernel/config > > > usb-gadget > > > $ ls /sys/kernel/config/usb-gadget > > > usb-function > > > $ cat usb-function > > > acm > > > ecm > > > ... > > > > ______________________________________ > > / Hello again. This is exactly what I \ > > | have in mind. Thank you. Let's just | call it a more descriptive > > name > > | like | > > \ 'available_functions' / > > -------------------------------------- > > \ ^__^ > > \ (Oo)\_______ > > (__)\ )\/\ > > ||----w | > > || || > > > > I have written this few times in previous emails but our new friend > could miss those emails so once again esp. for beautiful cow from > a rubber duck: > > IMPORTANT______________________________________________ > / \ > | Adding a file to usb_gadget directory is an *ABI break*.| an ABI break would be removing an existing file, not adding a new one. > \_________________ _____________________________________ / > // > // > ..---..// > .' _ `. > __..' (o) : > `..__ ; > `. / > ; `..---...___ > .' `~-. .-') > . ' _.' > : : > \ ' > + J > `._ _.' > `~--....___...---~' mh > > Currently each valid file name is also suitable for gadget. > There is no additional restrictions. > > No matter what name we will give to this new file this name > could be used previously by someone in userspace. > His program could be broken after kernel upgrade. the first thing a user of usb-gadget has to do, is create a directory, not a file. > Moreover some broken userspace programs may relay on fact that > usb-gadget directory contains only gadget dirs. And some > other things there is a lot of possible breaks in userspace. if there are any users who rely on the fact that *only* directories exist under usb-gadget, that's wrong. Imagine is sysfs would be forbidden of adding new files and directories. That's inside, it's crazy-talk :-) -- balbi
Attachment:
signature.asc
Description: Digital signature