Re: [RFC][PATCH] usb: gadget: Allow to build both USB functions and legacy gadgets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 07, 2016 at 11:59:57AM +0200, Krzysztof Opasiak wrote:
> Hi,
> 
> On Tue, Jun 7, 2016 at 11:06 AM, Peter Chen <peter.chen@xxxxxxx> wrote:
> >
> >
> >>-----Original Message-----
> >>From: linux-usb-owner@xxxxxxxxxxxxxxx [mailto:linux-usb-owner@xxxxxxxxxxxxxxx]
> >>On Behalf Of Krzysztof Opasiak
> >>Sent: Tuesday, June 07, 2016 3:46 PM
> >>To: Peter Chen <hzpeterchen@xxxxxxxxx>
> >>Cc: Krzysztof Opasiak <k.opasiak@xxxxxxxxxxx>; balbi@xxxxxxxxxx; Greg Kroah-
> >>Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>; Andrzej Pietrasiewicz
> >><andrzej.p@xxxxxxxxxxx>; Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>;
> >>linux-usb@xxxxxxxxxxxxxxx
> >>Subject: Re: [RFC][PATCH] usb: gadget: Allow to build both USB functions and
> >>legacy gadgets
> >>
> >>Hi,
> >>
> >>On Tue, Jun 7, 2016 at 3:27 AM, Peter Chen <hzpeterchen@xxxxxxxxx> wrote:
> >>> On Mon, Jun 06, 2016 at 09:40:33PM +0200, Krzysztof Opasiak wrote:
> >>>> Currently it is possible to build in some subset of usb functions
> >>>> *OR* some gadget module. This is limited only by Kconfig not any
> >>>> functionality.
> >>>>
> >>>> This patch removes this limitation. With this patch it is possible to
> >>>> set up all build combinations:
> >>>> 1) Multiple gadgets build in
> >>>
> >>> If that, what the user will expect if choosing multiple gadgets?
> >>> Eg, if he chooses g_ncm and g_mass_storage, will he expect his udc has
> >>> both mass_storage and ncm function, but it is not the fact, only the
> >>> first gadget function will work.
> >>>
> >>
> >>Not exactly one. You may build in multiple modules and use those multiple modules if
> >>you have multiple udcs.
> >>
> >
> > My concern is:  with your patch, the user may get unexpected results if he builds in
> > multiple gadgets for this single udc. At current code, the user can't do that, then he will
> > not get unexpected results. How do you consider that?
> >
> 
> That's true but even without this patch user may build multiple
> gadgets as a modules.
> 
> Even more, after commit (855ed04 "usb: gadget: udc-core: independent
> registration of
> gadgets and gadget drivers") it is possible to load multiple gadget
> modules even if we have one UDC.
> 
> So why would you like to disallow building in multiple gadgets if user
> can build them as a modules and simply load?

For module, the user can control which one to load, he or she can choose
which function he needs. But if they are build-in, the user may make
mistake and choose multiple gadgets, and get the unexpected results.
This is only I concern.

I just do not see the benefits that allow building in multiple gadgets,
If you have some use cases, then that's reason for doing that:)

> 
> If you concern about order of probing and binding to udc, I think that
> we can add udc module param to all legacy gadgets so user can specify
> in kernel cmd line where each gadget should be bound.
> 

Yes, currently, we can't do that even the gadget is module, but the
change may not be small. Now, we have configfs, it is not so necessary
to add this future.

-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux