On Thu, Jul 02, 2015 at 03:52:32PM +0200, Gregory CLEMENT wrote: > Hi Felipe, > > On 02/07/2015 15:14, Felipe Balbi wrote: > > On Thu, Jul 02, 2015 at 02:55:34PM +0200, Krzysztof Opasiak wrote: > >> > >> > >> On 07/02/2015 02:45 PM, Michal Nazarewicz wrote: > >>>> On Thu, Jul 02, 2015 at 12:51:54PM +0200, Gregory CLEMENT wrote: > >>>>> When I use configs to configure the mass storage function for the > >>>>> gadget, and when the device is plugged under Windows, then the > >>>>> partition that I expose is well managed, but I also see 7 other gadget > >>>>> in the device manager with error. > >>>>> > >>>>> This seven bogus gadget seems to be the 7 other LUN that are not > >>>>> used. Indeed if I apply this dirty patch: > >>>>> > >>>>> diff --git a/drivers/usb/gadget/function/f_mass_storage.c > >>>>> b/drivers/usb/gadget/function/f_mass_storage.c > >>>>> index 3cc109f..2b4ae98 100644 > >>>>> --- a/drivers/usb/gadget/function/f_mass_storage.c > >>>>> +++ b/drivers/usb/gadget/function/f_mass_storage.c > >>>>> @@ -3511,7 +3511,8 @@ static struct usb_function_instance > >>>>> *fsg_alloc_inst(void) > >>>>> rc = PTR_ERR(opts->common); > >>>>> goto release_opts; > >>>>> } > >>>>> - rc = fsg_common_set_nluns(opts->common, FSG_MAX_LUNS); > >>>>> +// rc = fsg_common_set_nluns(opts->common, FSG_MAX_LUNS); > >>>>> + rc = fsg_common_set_nluns(opts->common, 1); > >>>>> if (rc) > >>>>> goto release_opts; > >>>>> > >>>>> Then there is no more gadget error under Windows. As the value of > >>>>> FSG_MAX_LUNS is 8 and in my configuration I only use one partition, > >>>>> then it makes sens that I see 7 bogus gadgets. > >>>>> > >>>>> I also saw that in the legacy driver, it was possible to modify the > >>>>> number of LUN using the module parameter file_count. > >>> > >>> On Thu, Jul 02 2015, Felipe Balbi wrote: > >>>> This has been reported. Michal was working on a fix, but the patch > >>>> hasn't been applied yet. > >>> > >>> I’ve came up with [1], which you should feel free to test, but then > >>> Krzysztof came along with [2], which among other things addressed the > >>> LUN count issue, and I kind of stopped working on the issue waiting for > >>> his follow up. > >> > >> Sorry that it took so much time. I have been quite busy with some other > >> things. I will send fixed version of that series in a few hours. > > > > I'm taking Michal's patch as a quick fix for the -rc though. That patch > > is simple enough to get in and solves the issue at hand. > > I would like to test the patch, is it the one included in the following email > ? > > http://www.spinics.net/lists/linux-usb/msg126292.html
I just pushed it to my testing/fixes, if you test that, I can still add your Tested-by, thanks -- balbi
signature.asc
Description: Digital signature