Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-09 Thread Michal Nazarewicz
>> On Tue, Oct 07 2014, Alan Stern wrote: >>> If you want to allow for the possibility of orderly shutdown (and maybe >>> even possible restart) of a userspace handler, the function library >>> should first tell the kernel explicitly to disconnect. > On Tue, 7 Oct 2014, Michal Nazarewicz wrote:

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-08 Thread Alan Stern
On Tue, 7 Oct 2014, Michal Nazarewicz wrote: > > On Tue, 7 Oct 2014, Felipe Balbi wrote: > >> Right, but if we allow this, I can already see folks abusing to > >> connect to the host early and only when necessary do some trickery to > >> e.g. start adbd (not saying Android will do this, just using

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-08 Thread Michal Nazarewicz
>> -Original Message- >> From: Mike Nazarewicz [mailto:m...@google.com] >> I don't really see that happening. For the gadget to start all >> descriptors need to be known. Functionfs will know the descriptors >> only once the user space daemon provides them. Therefore, with the >> current

RE: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-08 Thread Krzysztof Opasiak
inux-usb@vger.kernel.org; linux- > ker...@vger.kernel.org; andrze...@samsung.com > Subject: Re: [PATCH] usb: gadget: f_fs: add "zombie" mode > > > On Tue, 7 Oct 2014, Felipe Balbi wrote: > >> Right, but if we allow this, I can already see folks abusing to > >&g

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-07 Thread Michal Nazarewicz
> On Tue, 7 Oct 2014, Felipe Balbi wrote: >> Right, but if we allow this, I can already see folks abusing to >> connect to the host early and only when necessary do some trickery to >> e.g. start adbd (not saying Android will do this, just using it as an >> easy example). I don't really see that h

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-07 Thread Alan Stern
On Tue, 7 Oct 2014, Felipe Balbi wrote: > > If the file handle was closed for abnormal reasons, we can behave like > > crashed firmware. Which means, in the end, doing the same thing as in > > the normal-reason case -- i.e., do nothing. In particular, don't > > disconnect. > > > > If you wan

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-07 Thread Felipe Balbi
Hi, On Tue, Oct 07, 2014 at 02:42:33PM -0400, Alan Stern wrote: > > > It seems to me that we should imitate what an ordinary USB device would > > > do. If part of the firmware crashes, generally you would expect none > > > of the endpoints associated with that function to work. Either they > > >

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-07 Thread Alan Stern
On Tue, 7 Oct 2014, Felipe Balbi wrote: > > It seems to me that we should imitate what an ordinary USB device would > > do. If part of the firmware crashes, generally you would expect none > > of the endpoints associated with that function to work. Either they > > refuse to accept output from th

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-07 Thread Felipe Balbi
Hi, On Tue, Oct 07, 2014 at 01:15:32PM -0400, Alan Stern wrote: > > > Here also I agree. Zombie mode should "mock" the function until first > > > next enumeration or unbind. It should not be possible to bind gadget > > > with function in zombie mode to UDC. Zombie mode should "pretend" only > > >

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-07 Thread Alan Stern
On Tue, 7 Oct 2014, Felipe Balbi wrote: > > Please believe me that I totally agree with you, but I also see Robert's > > point. Let's take ADB as example. Before ADB has been ported to > > FunctionFS it communicated with kernel using dev node provided by ADB > > function driver. With that infrastr

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-07 Thread Felipe Balbi
Hi, On Tue, Oct 07, 2014 at 06:37:26PM +0200, Krzysztof Opasiak wrote: [snip] > > yeah, and the way to deal with that is disconnecting from the host > > because that USB function, can't be functional anymore. I mean, > > imagine you try to e.g. unload pictures from your nice DSLR and > > that DS

RE: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-07 Thread Krzysztof Opasiak
> min...@mina86.com; andrze...@samsung.com > Subject: Re: [PATCH] usb: gadget: f_fs: add "zombie" mode > > Hi, > > On Tue, Oct 07, 2014 at 05:01:15PM +0200, Krzysztof Opasiak wrote: > > > > > Hi, > > > > > > > > > > On Mon, O

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-07 Thread Felipe Balbi
Hi, On Tue, Oct 07, 2014 at 05:01:15PM +0200, Krzysztof Opasiak wrote: > > > > Hi, > > > > > > > > On Mon, Oct 06, 2014 at 01:25:14PM +0200, Robert Baldyga wrote: > > > >> Since we can compose gadgets from many functions, there is the > > > >> problem related to gadget breakage while FunctionFS da

RE: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-07 Thread Krzysztof Opasiak
andrze...@samsung.com; k.opas...@samsung.com > Subject: Re: [PATCH] usb: gadget: f_fs: add "zombie" mode > > Hi, > > On Tue, Oct 07, 2014 at 08:33:16AM +0200, Robert Baldyga wrote: > > On 10/07/2014 04:28 AM, Felipe Balbi wrote: > > > Hi, > > >

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-07 Thread Felipe Balbi
Hi, On Tue, Oct 07, 2014 at 08:33:16AM +0200, Robert Baldyga wrote: > On 10/07/2014 04:28 AM, Felipe Balbi wrote: > > Hi, > > > > On Mon, Oct 06, 2014 at 01:25:14PM +0200, Robert Baldyga wrote: > >> Since we can compose gadgets from many functions, there is the problem > >> related to gadget brea

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-06 Thread Robert Baldyga
On 10/07/2014 04:28 AM, Felipe Balbi wrote: > Hi, > > On Mon, Oct 06, 2014 at 01:25:14PM +0200, Robert Baldyga wrote: >> Since we can compose gadgets from many functions, there is the problem >> related to gadget breakage while FunctionFS daemon being closed. In some >> cases it's strongly desired

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-06 Thread Felipe Balbi
Hi, On Mon, Oct 06, 2014 at 01:25:14PM +0200, Robert Baldyga wrote: > Since we can compose gadgets from many functions, there is the problem > related to gadget breakage while FunctionFS daemon being closed. In some > cases it's strongly desired to keep gadget alive for a while, despite > Function

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-06 Thread Michal Nazarewicz
> On 10/06/2014 02:36 PM, Michal Nazarewicz wrote: >> However, all the ep# files will still exist on the filesystem. This may >> be a bit confusing and error-prone, no? On Mon, Oct 06 2014, Robert Baldyga wrote: > Shouldn't be error-prone, because opening them will fail with -ENODEV, > but indee

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-06 Thread Robert Baldyga
On 10/06/2014 02:36 PM, Michal Nazarewicz wrote: > On Mon, Oct 06 2014, Robert Baldyga wrote: >> Since we can compose gadgets from many functions, there is the problem >> related to gadget breakage while FunctionFS daemon being closed. In some >> cases it's strongly desired to keep gadget alive fo

Re: [PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-06 Thread Michal Nazarewicz
On Mon, Oct 06 2014, Robert Baldyga wrote: > Since we can compose gadgets from many functions, there is the problem > related to gadget breakage while FunctionFS daemon being closed. In some > cases it's strongly desired to keep gadget alive for a while, despite > FunctionFS files are closed, to a

[PATCH] usb: gadget: f_fs: add "zombie" mode

2014-10-06 Thread Robert Baldyga
Since we can compose gadgets from many functions, there is the problem related to gadget breakage while FunctionFS daemon being closed. In some cases it's strongly desired to keep gadget alive for a while, despite FunctionFS files are closed, to allow another functions to complete some presumably c