Re: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-05 Thread Benjamin Herrenschmidt
On Fri, 2019-07-05 at 14:28 -0400, Alan Stern wrote: > On Fri, 5 Jul 2019, Benjamin Herrenschmidt wrote: > > > (following our conversation) > > > > Here's a completely untested alternative patch (it replaces my previous > > one) that fixes it a bit differently. > > > > This time it should handle

Re: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-05 Thread Benjamin Herrenschmidt
On Fri, 2019-07-05 at 10:30 -0400, Alan Stern wrote: > I haven't looked at the new patches yet. > > Still, what I originally had in mind for this situation was that the > _last_ event should always take precedence. This goes against the idea > of having separate FSG_STATE_* levels for disconnec

Re: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-05 Thread Alan Stern
On Fri, 5 Jul 2019, Benjamin Herrenschmidt wrote: > (following our conversation) > > Here's a completely untested alternative patch (it replaces my previous > one) that fixes it a bit differently. > > This time it should handle the case of a disconnect happening > before we have dequeued a confi

Re: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-05 Thread Alan Stern
On Fri, 5 Jul 2019, Benjamin Herrenschmidt wrote: > On Fri, 2019-07-05 at 10:49 +, EJ Hsu wrote: > > > > Yes, looks like we are facing the same issue. > > > > The change of Ben is similar to mine, but the priority of > > FSG_STATE_CONFIG_CHANGE in his patch is higher than FSG_STATE_CONFIG_C

Re: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-05 Thread Benjamin Herrenschmidt
(following our conversation) Here's a completely untested alternative patch (it replaces my previous one) that fixes it a bit differently. This time it should handle the case of a disconnect happening before we have dequeued a config change. This assumes that it's correct to never call usb_compo

Re: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-05 Thread Benjamin Herrenschmidt
On Fri, 2019-07-05 at 10:49 +, EJ Hsu wrote: > The change for my previous patch is as follows, and it works well on my local > test. > > Thanks, > EJ > > diff --git a/drivers/usb/gadget/function/f_mass_storage.c > b/drivers/usb/gadget/function/f_mass_storage.c > index 982c3e8..b5f1e1e 10064

Re: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-05 Thread Benjamin Herrenschmidt
On Fri, 2019-07-05 at 10:49 +, EJ Hsu wrote: > > Yes, looks like we are facing the same issue. > > The change of Ben is similar to mine, but the priority of > FSG_STATE_CONFIG_CHANGE in his patch is higher than FSG_STATE_CONFIG_CLEAR. > So, it will not hit the USB CV TD 9.13 failure as above

RE: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-05 Thread EJ Hsu
Alan Stern wrote: > On Thu, 4 Jul 2019, EJ Hsu wrote: > > > Based on my initial debugging, USB CV TD 9.13 will consecutively set device > to configuration #1 by sending "Set Configuration" transfer. > > So, in set_config() function, it will try to disable each interface first > > and then > set u

RE: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-04 Thread Alan Stern
On Thu, 4 Jul 2019, EJ Hsu wrote: > Based on my initial debugging, USB CV TD 9.13 will consecutively set device > to configuration #1 by sending "Set Configuration" transfer. > So, in set_config() function, it will try to disable each interface first and > then set up each interface. That is, th

RE: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-04 Thread EJ Hsu
Based on my initial debugging, USB CV TD 9.13 will consecutively set device to configuration #1 by sending "Set Configuration" transfer. So, in set_config() function, it will try to disable each interface first and then set up each interface. That is, the fsg_disable() will be called first and t

RE: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-03 Thread EJ Hsu
EJ Hsu wrote: > Thinh Nguyen wrote: > > Alan Stern wrote: > >> On Tue, 2 Jul 2019, Thinh Nguyen wrote: > >> > >>> Hi, > >>> > >>> Alan Stern wrote: > On Fri, 10 May 2019, EJ Hsu wrote: > > > This change is to fix below warning message in following scenario: > > usb_composite_setup

Re: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-02 Thread Thinh Nguyen
Thinh Nguyen wrote: > Alan Stern wrote: >> On Tue, 2 Jul 2019, Thinh Nguyen wrote: >> >>> Hi, >>> >>> Alan Stern wrote: On Fri, 10 May 2019, EJ Hsu wrote: > This change is to fix below warning message in following scenario: > usb_composite_setup_continue: Unexpected call > >>>

Re: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-02 Thread Alan Stern
On Tue, 2 Jul 2019, Thinh Nguyen wrote: > Hi, > > Alan Stern wrote: > > On Fri, 10 May 2019, EJ Hsu wrote: > > > >> This change is to fix below warning message in following scenario: > >> usb_composite_setup_continue: Unexpected call > >> > >> When system tried to enter suspend, the fsg_disable()

Re: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-01 Thread Thinh Nguyen
Hi, Alan Stern wrote: > On Fri, 10 May 2019, EJ Hsu wrote: > >> This change is to fix below warning message in following scenario: >> usb_composite_setup_continue: Unexpected call >> >> When system tried to enter suspend, the fsg_disable() will be called to >> disable fsg driver and send a signal

Re: [PATCH V3] usb: gadget: storage: Remove warning message

2019-05-10 Thread Alan Stern
On Fri, 10 May 2019, EJ Hsu wrote: > This change is to fix below warning message in following scenario: > usb_composite_setup_continue: Unexpected call > > When system tried to enter suspend, the fsg_disable() will be called to > disable fsg driver and send a signal to fsg_main_thread. However, a

[PATCH V3] usb: gadget: storage: Remove warning message

2019-05-10 Thread EJ Hsu
This change is to fix below warning message in following scenario: usb_composite_setup_continue: Unexpected call When system tried to enter suspend, the fsg_disable() will be called to disable fsg driver and send a signal to fsg_main_thread. However, at this point, the fsg_main_thread has already