Re: [PATCH v14 4/9] usb: Add max_speed to usb_composite_driver structure

Felipe Balbi
2011-06-06T11:37:52Z

[-- Attachment #1: Type: text/plain, Size: 2066 bytes --]

Hi,

On Mon, Jun 06, 2011 at 02:33:32PM +0300, Tanya Brokhman wrote:
> > On Tue, May 31, 2011 at 04:18:24PM +0300, Tatyana Brokhman wrote:
> > > This field is used by the Gadget drivers to specify the maximum speed
> > > they support, meaning: the maximum speed they can provide descriptors
> > for.
> > >
> > > The driver speed will be set in consideration of this value.
> > >
> > > Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
> >
> > personally, I don't think this is good enough. The gadget speed is
> > actually the min() of the f_* speeds. So, IMHO this should be coming
> > from f_* and during bind you would:
> >
> > gadget->speed = min(f->speed, gadget->speed);
> >
> > for all functions. Also, both this patch and what I described above,
> > only works considering nobody touches that enum, so we might want to be
> > careful and add some comments to the enum to avoid anyone from touching
> > that :-)
>
> You're right, the full and best solution would be to set driver speed as the
> minimum of all the speeds its functions support. (Please note that it's the
> usb_composite_driver speed we're talking about and not the speed of the
> gadget).
> Unfortunately, we need to determine the driver speed before any of the
> functions binded to it so the above solution isn't possible.
> In any case, gadget->speed is determined upon real connection to the host
> that can occur long after the f-> bind() and it depends on whether for
> example SS HW negotiation protocol succeeded or failed.

true, let's take your approach for now.

But we might still want to force HighSpeed even though the HW has
SuperSpeed support. The real solution, for the long run would be to
always start with pullups disabled (iow, don't connect to host
immediately) and only connect after the gadget driver is all
initialized, then we will know the gadget speed before connecting, and
we can have the gadget driver "request" for a particular speed from the
controller.

For now, let's take your approach.

--
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]