[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1711011133220.1770-100000@iolanthe.rowland.org>
Date: Wed, 1 Nov 2017 11:45:53 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Roger Quadros <rogerq@...com>
cc: balbi@...nel.org, <Dylan.Howey@...nantco.com>,
<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
"# v4 . 13+" <stable@...r.kernel.org>
Subject: Re: [PATCH v2][RESEND] usb: gadget: core: Fix ->udc_set_speed()
speed handling
On Wed, 1 Nov 2017, Roger Quadros wrote:
> > Roger, would you like to send in a follow-up patch that removes the now
> > unnecessary code from dummy_udc_set_speed() in dummy_hcd.c?
> >
>
> Sure. I have a question though.
>
> In dummy_udc_set_speed() we should just set gadget.speed to whatever is passed in speed.
> This will be the maximum supported speed by the gadget function driver.
Following your patch, it will be the maximum speed supported by the
gadget function driver or the maximum speed supported by the UDC
driver, whichever is lower. That's the whole point of your patch,
right?
> However, is it possible that the gadget will be connected at a lower speed than that?
Yes, it is possible to connect at a speed lower than the function
driver's maximum speed. The connection speed for dummy-hcd is
controlled by a pair of module parameters: is_super_speed and
is_high_speed.
> I see gadget.speed being updated in dummy_hub_control() GetPortStatus: case, but not
> in case of USB_SPEED_HIGH and USB_SPEED_LOW.
Here's what the code does, in outline form:
switch (dum_hcd->dum->gadget.speed) {
case USB_SPEED_HIGH:
...
break;
case USB_SPEED_LOW:
...
break;
default:
dum_hcd->dum->gadget.speed = USB_SPEED_FULL;
break;
}
In other words, if gadget.speed isn't USB_SPEED_HIGH or USB_SPEED_LOW,
set it to USB_SPEED_FULL. And this is all under the case where the
connection is USB-2, not USB-3 or higher.
How is this related to the requested change to dummy_udc_set_speed()?
Alan Stern
Powered by blists - more mailing lists