Re: USB gadgets with configfs hang reboot

2016-05-06 Thread Pali Rohár
On Monday 18 April 2016 10:02:57 Ivaylo Dimitrov wrote: > > > On 8.04.2016 23:13, Ivaylo Dimitrov wrote: > >Hi, > > > >On 16.01.2016 12:40, Ivaylo Dimitrov wrote: > >>Hi, > >> > >>On 16.01.2016 00:48, Tony Lindgren wrote: > >>>Hi all, > >>> > >>>Looks like there's some issue with the USB gadgets

Re: USB gadgets with configfs hang reboot

2016-04-26 Thread Ivaylo Dimitrov
On 26.04.2016 19:49, Tony Lindgren wrote: * Ivaylo Dimitrov [160426 09:46]: On 26.04.2016 18:03, Alan Stern wrote: On Tue, 26 Apr 2016, Felipe Balbi wrote: Is there a reason why a process (pnatd in this particular case) doesn't get killed on reboot? there might be, and that's probably

Re: USB gadgets with configfs hang reboot

2016-04-26 Thread Ivaylo Dimitrov
On 26.04.2016 18:03, Alan Stern wrote: On Tue, 26 Apr 2016, Felipe Balbi wrote: Is there a reason why a process (pnatd in this particular case) doesn't get killed on reboot? there might be, and that's probably the bug we're trying to figure out. But so far, no idea. One possible reason is

Re: USB gadgets with configfs hang reboot

2016-04-26 Thread Tony Lindgren
* Ivaylo Dimitrov [160426 09:46]: > > > On 26.04.2016 18:03, Alan Stern wrote: > >On Tue, 26 Apr 2016, Felipe Balbi wrote: > > > >>>Is there a reason why a process (pnatd in this particular case) doesn't > >>>get killed on reboot? > >> > >>there might be, and that's probably the bug we're trying

Re: USB gadgets with configfs hang reboot

2016-04-26 Thread Alan Stern
On Tue, 26 Apr 2016, Felipe Balbi wrote: > > Is there a reason why a process (pnatd in this particular case) doesn't > > get killed on reboot? > > there might be, and that's probably the bug we're trying to figure > out. But so far, no idea. One possible reason is that the process is in an unin

Re: USB gadgets with configfs hang reboot

2016-04-25 Thread Felipe Balbi
Hi, Ivaylo Dimitrov writes: > Looks like there's some issue with the USB gadgets and configfs. > > I'm seeing rmmod of the UDC driver cause a warning and then reboot > hangs the system. This happens at least with v4.4, and I've reproduced > it with dwc3 and musb so it seems t

Re: USB gadgets with configfs hang reboot

2016-04-25 Thread Ivaylo Dimitrov
Hi, On 18.04.2016 10:55, Felipe Balbi wrote: Hi, Ivaylo Dimitrov writes: Hi, On 16.01.2016 12:40, Ivaylo Dimitrov wrote: Hi, On 16.01.2016 00:48, Tony Lindgren wrote: Hi all, Looks like there's some issue with the USB gadgets and configfs. I'm seeing rmmod of the UDC driver cause a war

Re: USB gadgets with configfs hang reboot

2016-04-18 Thread Felipe Balbi
Hi, Ivaylo Dimitrov writes: > Hi, > > On 16.01.2016 12:40, Ivaylo Dimitrov wrote: >> Hi, >> >> On 16.01.2016 00:48, Tony Lindgren wrote: >>> Hi all, >>> >>> Looks like there's some issue with the USB gadgets and configfs. >>> >>> I'm seeing rmmod of the UDC driver cause a warning and then reboot

Re: USB gadgets with configfs hang reboot

2016-04-18 Thread Ivaylo Dimitrov
On 8.04.2016 23:13, Ivaylo Dimitrov wrote: Hi, On 16.01.2016 12:40, Ivaylo Dimitrov wrote: Hi, On 16.01.2016 00:48, Tony Lindgren wrote: Hi all, Looks like there's some issue with the USB gadgets and configfs. ... (copied from "Re: [PATCH] usb: f_mass_storage: test whether thread is r

Re: USB gadgets with configfs hang reboot

2016-04-08 Thread Ivaylo Dimitrov
Hi, On 16.01.2016 12:40, Ivaylo Dimitrov wrote: Hi, On 16.01.2016 00:48, Tony Lindgren wrote: Hi all, Looks like there's some issue with the USB gadgets and configfs. I'm seeing rmmod of the UDC driver cause a warning and then reboot hangs the system. This happens at least with v4.4, and I'v

Re: USB gadgets with configfs hang reboot

2016-04-05 Thread Michal Nazarewicz
On Fri, Apr 01 2016, Michal Nazarewicz wrote: > For legacy/nokia setting no_configfs should be a valid solution: > > >8 > diff --git a/drivers/usb/gadget/legacy/nokia.c > b/drivers/usb/gadget/legacy/nokia.c > index 0997504..e4bc

Re: USB gadgets with configfs hang reboot

2016-04-04 Thread Alan Stern
On Mon, 4 Apr 2016, Michal Nazarewicz wrote: > On Mon, Apr 04 2016, Alan Stern wrote: > > So there is no way to add a single function to several configurations? > > There is. f_mass_storage (and any other usb_function_instance) simply > has to have multiple usb_function structures. > > > It sou

Re: USB gadgets with configfs hang reboot

2016-04-04 Thread Michal Nazarewicz
On Mon, Apr 04 2016, Ivaylo Dimitrov wrote: > Who and when is going to destroy the thread if one does > "/sys/bus/platform/drivers/musb-hdrc# echo musb-hdrc.0.auto > unbind"? > Wouldn't some kind of refcounting make sense here? Currently the thread is killed when fsg_common structure is released a

Re: USB gadgets with configfs hang reboot

2016-04-04 Thread Michal Nazarewicz
On Mon, Apr 04 2016, Alan Stern wrote: > So there is no way to add a single function to several configurations? There is. f_mass_storage (and any other usb_function_instance) simply has to have multiple usb_function structures. > It sounds like there are two problems then. The first problem is

Re: USB gadgets with configfs hang reboot

2016-04-04 Thread Ivaylo Dimitrov
Hi, On 4.04.2016 15:57, Michal Nazarewicz wrote: On Sat, Apr 02 2016, Alan Stern wrote: On Sat, 2 Apr 2016, Michal Nazarewicz wrote: Because of all that, I think the best course of action is to just check whether the thread is running and conditionally start it in fsg_bind, i.e.: --- a/driv

Re: USB gadgets with configfs hang reboot

2016-04-04 Thread Alan Stern
On Mon, 4 Apr 2016, Michal Nazarewicz wrote: > On Sat, Apr 02 2016, Alan Stern wrote: > > On Sat, 2 Apr 2016, Michal Nazarewicz wrote: > >> At the same time, mass storage should work fine if it’s bound to > >> multiple configurations. Only one configuration can be active at any > >> given time so

Re: USB gadgets with configfs hang reboot

2016-04-04 Thread Michal Nazarewicz
On Sat, Apr 02 2016, Alan Stern wrote: > On Sat, 2 Apr 2016, Michal Nazarewicz wrote: >> At the same time, mass storage should work fine if it’s bound to >> multiple configurations. Only one configuration can be active at any >> given time so interfaces on different configurations cannot interfere

Re: USB gadgets with configfs hang reboot

2016-04-03 Thread Felipe Balbi
Hi, Alan Stern writes: > On Thu, 31 Mar 2016, Ivaylo Dimitrov wrote: > >> > This isn't supposed to cause any problems. The two instances should >> > never run at the same time, because they belong to different configs. >> > >> >> The problem seems to be that fsg driver creates a thread for eve

Re: USB gadgets with configfs hang reboot

2016-04-03 Thread Felipe Balbi
Hi, Ivaylo Dimitrov writes: >>> Looks like there's some issue with the USB gadgets and configfs. >>> >>> I'm seeing rmmod of the UDC driver cause a warning and then reboot >>> hangs the system. This happens at least with v4.4, and I've >>> reproduced

Re: USB gadgets with configfs hang reboot

2016-04-02 Thread Alan Stern
On Sat, 2 Apr 2016, Michal Nazarewicz wrote: > > I'm not so sure about this. Earlier I was undecided about what to do > > if there are multiple mass-storage interfaces in the same config, but > > now I realize that one thread won't work in that situation. The > > difficulty is exception handling

Re: USB gadgets with configfs hang reboot

2016-04-01 Thread Michal Nazarewicz
> On Fri, 1 Apr 2016, Michal Nazarewicz wrote: >> @@ -3050,9 +3053,11 @@ static int fsg_bind(struct usb_configuration *c, >> struct usb_function *f) >> if (ret) >> return ret; >> fsg_common_set_inquiry_string(fsg->common, NULL, NULL); >> -

Re: USB gadgets with configfs hang reboot

2016-04-01 Thread Alan Stern
On Fri, 1 Apr 2016, Michal Nazarewicz wrote: > On Thu, Mar 31 2016, Alan Stern wrote: > > Michal, I'm not sure how you intended to handle this. > > For legacy/nokia setting no_configfs should be a valid solution: > > >8 > diff

Re: USB gadgets with configfs hang reboot

2016-04-01 Thread Michal Nazarewicz
On Thu, Mar 31 2016, Alan Stern wrote: > Michal, I'm not sure how you intended to handle this. For legacy/nokia setting no_configfs should be a valid solution: >8 diff --git a/drivers/usb/gadget/legacy/nokia.c b/drivers/usb/ga

Re: USB gadgets with configfs hang reboot

2016-03-31 Thread Alan Stern
On Thu, 31 Mar 2016, Ivaylo Dimitrov wrote: > > This isn't supposed to cause any problems. The two instances should > > never run at the same time, because they belong to different configs. > > > > The problem seems to be that fsg driver creates a thread for every > fsg_bind() call, which overw

Re: USB gadgets with configfs hang reboot

2016-03-31 Thread Ivaylo Dimitrov
On 30.03.2016 22:25, Alan Stern wrote: On Wed, 30 Mar 2016, Ivaylo Dimitrov wrote: seems to be created twice :). Maybe the problem is that the first time musb-hdrc is probed it fails with -EPROBE_DEFER, however that failure is after gadget drivers got loaded and noone unloads them. gadget d

Re: USB gadgets with configfs hang reboot

2016-03-30 Thread Tony Lindgren
* Alan Stern [160330 12:26]: > On Wed, 30 Mar 2016, Ivaylo Dimitrov wrote: > > > >>> seems to be created twice :). Maybe the problem is that the first time > > >>> musb-hdrc is probed it fails with -EPROBE_DEFER, however that failure is > > >>> after gadget drivers got loaded and noone unloads th

Re: USB gadgets with configfs hang reboot

2016-03-30 Thread Alan Stern
On Wed, 30 Mar 2016, Ivaylo Dimitrov wrote: > >>> seems to be created twice :). Maybe the problem is that the first time > >>> musb-hdrc is probed it fails with -EPROBE_DEFER, however that failure is > >>> after gadget drivers got loaded and noone unloads them. > >> > >> gadget drivers will get ad

Re: USB gadgets with configfs hang reboot

2016-03-30 Thread Ivaylo Dimitrov
On 30.03.2016 21:50, Ivaylo Dimitrov wrote: On 30.03.2016 17:01, Ivaylo Dimitrov wrote: On 30.03.2016 16:38, Felipe Balbi wrote: Hi, Ivaylo Dimitrov writes: Ivaylo Dimitrov writes: Ivaylo Dimitrov writes: Ivaylo Dimitrov writes: On 16.01.2016 12:40, Ivaylo Dimitrov wrote: Hi,

Re: USB gadgets with configfs hang reboot

2016-03-30 Thread Ivaylo Dimitrov
On 30.03.2016 17:01, Ivaylo Dimitrov wrote: On 30.03.2016 16:38, Felipe Balbi wrote: Hi, Ivaylo Dimitrov writes: Ivaylo Dimitrov writes: Ivaylo Dimitrov writes: Ivaylo Dimitrov writes: On 16.01.2016 12:40, Ivaylo Dimitrov wrote: Hi, On 16.01.2016 00:48, Tony Lindgren wrote: Hi a

Re: USB gadgets with configfs hang reboot

2016-03-30 Thread Pali Rohár
On Wednesday 30 March 2016 16:01:53 Ivaylo Dimitrov wrote: > On 30.03.2016 16:38, Felipe Balbi wrote: > > Hi, > > > > Ivaylo Dimitrov writes: > >>> Ivaylo Dimitrov writes: > > Ivaylo Dimitrov writes: > >>> Ivaylo Dimitrov writes: > On 16.01.2016 12:40, Ivaylo Dimitrov wrote: >

Re: USB gadgets with configfs hang reboot

2016-03-30 Thread Ivaylo Dimitrov
On 30.03.2016 16:38, Felipe Balbi wrote: Hi, Ivaylo Dimitrov writes: Ivaylo Dimitrov writes: Ivaylo Dimitrov writes: Ivaylo Dimitrov writes: On 16.01.2016 12:40, Ivaylo Dimitrov wrote: Hi, On 16.01.2016 00:48, Tony Lindgren wrote: Hi all, Looks like there's some issue with the USB

Re: USB gadgets with configfs hang reboot

2016-03-30 Thread Felipe Balbi
Hi, Ivaylo Dimitrov writes: >> Ivaylo Dimitrov writes: Ivaylo Dimitrov writes: >> Ivaylo Dimitrov writes: >>> On 16.01.2016 12:40, Ivaylo Dimitrov wrote: Hi, On 16.01.2016 00:48, Tony Lindgren wrote: > Hi all, > > Looks like ther

Re: USB gadgets with configfs hang reboot

2016-03-30 Thread Ivaylo Dimitrov
Hi, On 30.03.2016 13:22, Felipe Balbi wrote: Hi, Ivaylo Dimitrov writes: Ivaylo Dimitrov writes: Ivaylo Dimitrov writes: On 16.01.2016 12:40, Ivaylo Dimitrov wrote: Hi, On 16.01.2016 00:48, Tony Lindgren wrote: Hi all, Looks like there's some issue with the USB gadgets and configfs.

Re: USB gadgets with configfs hang reboot

2016-03-30 Thread Felipe Balbi
Hi, Ivaylo Dimitrov writes: >> Ivaylo Dimitrov writes: Ivaylo Dimitrov writes: > On 16.01.2016 12:40, Ivaylo Dimitrov wrote: >> Hi, >> >> On 16.01.2016 00:48, Tony Lindgren wrote: >>> Hi all, >>> >>> Looks like there's some issue with the USB gadgets and config

Re: USB gadgets with configfs hang reboot

2016-03-24 Thread Ivaylo Dimitrov
Hi, On 24.03.2016 09:11, Felipe Balbi wrote: Hi, Ivaylo Dimitrov writes: Ivaylo Dimitrov writes: On 16.01.2016 12:40, Ivaylo Dimitrov wrote: Hi, On 16.01.2016 00:48, Tony Lindgren wrote: Hi all, Looks like there's some issue with the USB gadgets and configfs. I'm seeing rmmod of the U

Re: USB gadgets with configfs hang reboot

2016-03-24 Thread Felipe Balbi
Hi, Ivaylo Dimitrov writes: >> Ivaylo Dimitrov writes: >>> On 16.01.2016 12:40, Ivaylo Dimitrov wrote: Hi, On 16.01.2016 00:48, Tony Lindgren wrote: > Hi all, > > Looks like there's some issue with the USB gadgets and configfs. > > I'm seeing rmmod of the UDC

Re: USB gadgets with configfs hang reboot

2016-03-24 Thread Ivaylo Dimitrov
Hi, On 24.03.2016 08:50, Felipe Balbi wrote: Hi, Ivaylo Dimitrov writes: On 16.01.2016 12:40, Ivaylo Dimitrov wrote: Hi, On 16.01.2016 00:48, Tony Lindgren wrote: Hi all, Looks like there's some issue with the USB gadgets and configfs. I'm seeing rmmod of the UDC driver cause a warning

Re: USB gadgets with configfs hang reboot

2016-03-23 Thread Felipe Balbi
Hi, Ivaylo Dimitrov writes: > On 16.01.2016 12:40, Ivaylo Dimitrov wrote: >> Hi, >> >> On 16.01.2016 00:48, Tony Lindgren wrote: >>> Hi all, >>> >>> Looks like there's some issue with the USB gadgets and configfs. >>> >>> I'm seeing rmmod of the UDC driver cause a warning and then reboot >>> han

Re: USB gadgets with configfs hang reboot

2016-03-23 Thread Ivaylo Dimitrov
Hi On 16.01.2016 12:40, Ivaylo Dimitrov wrote: Hi, On 16.01.2016 00:48, Tony Lindgren wrote: Hi all, Looks like there's some issue with the USB gadgets and configfs. I'm seeing rmmod of the UDC driver cause a warning and then reboot hangs the system. This happens at least with v4.4, and I've

Re: USB gadgets with configfs hang reboot

2016-01-22 Thread Tony Lindgren
* Andrzej Pietrasiewicz [160122 02:36]: > Hi Tony, > > W dniu 15.01.2016 o 23:48, Tony Lindgren pisze: > >Hi all, > > > >Looks like there's some issue with the USB gadgets and configfs. > > > >I'm seeing rmmod of the UDC driver cause a warning and then reboot > >hangs the system. This happens at

Re: USB gadgets with configfs hang reboot

2016-01-22 Thread Andrzej Pietrasiewicz
Hi Tony, W dniu 15.01.2016 o 23:48, Tony Lindgren pisze: Hi all, Looks like there's some issue with the USB gadgets and configfs. I'm seeing rmmod of the UDC driver cause a warning and then reboot hangs the system. This happens at least with v4.4, and I've reproduced it with dwc3 and musb so i