usb: gadget: zero: Fix SuperSpeed enumeration for alternate setting 1

Message ID 1395826086-5097-1-git-send-email-rogerq@ti.com
State Superseded
Headers show

Commit Message

Roger Quadros March 26, 2014, 9:28 a.m.
It was impossible to enumerate on a SuperSpeed (XHCI) host
with alternate setting = 1 due to the wrongly set 'bMaxBurst'
field in the SuperSpeed Endpoint Companion descriptor.

Testcase:
<host> modprobe -r usbtest; modprobe usbtest alt=1
<device> modprobe g_zero
plug device to SuperSpeed port on the host.

Without this patch the host always complains like so
"usb 12-2: Not enough bandwidth for new device state.
 usb 12-2: Not enough bandwidth for altsetting 1"

Bug was introduced by commit cf9a08ae in v3.9

Cc: 3.9+ <stable@vger.kernel.org> # 3.9+
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/gadget/zero.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sebastian Andrzej Siewior March 26, 2014, 10:50 a.m. | #1
On 03/26/2014 10:28 AM, Roger Quadros wrote:
> Bug was introduced by commit cf9a08ae in v3.9

I'm sorry for the trouble.

Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Sergei Shtylyov March 26, 2014, 1:06 p.m. | #2
Hello.

On 26-03-2014 13:28, Roger Quadros wrote:

> It was impossible to enumerate on a SuperSpeed (XHCI) host
> with alternate setting = 1 due to the wrongly set 'bMaxBurst'
> field in the SuperSpeed Endpoint Companion descriptor.

> Testcase:
> <host> modprobe -r usbtest; modprobe usbtest alt=1
> <device> modprobe g_zero
> plug device to SuperSpeed port on the host.

> Without this patch the host always complains like so
> "usb 12-2: Not enough bandwidth for new device state.
>   usb 12-2: Not enough bandwidth for altsetting 1"

> Bug was introduced by commit cf9a08ae in v3.9

    Please also specify that commit's summary in parens. Also, there's now an 
adopted standard way of saying this:

Fixes: <12-digit SHA ID> ("<summary line>")

> Cc: 3.9+ <stable@vger.kernel.org> # 3.9+
> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Reviewed-by: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Roger Quadros <rogerq@ti.com>

WBR, Sergei


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Roger Quadros March 26, 2014, 2:42 p.m. | #3
On 03/26/2014 03:06 PM, Sergei Shtylyov wrote:
> Hello.
> 
> On 26-03-2014 13:28, Roger Quadros wrote:
> 
>> It was impossible to enumerate on a SuperSpeed (XHCI) host
>> with alternate setting = 1 due to the wrongly set 'bMaxBurst'
>> field in the SuperSpeed Endpoint Companion descriptor.
> 
>> Testcase:
>> <host> modprobe -r usbtest; modprobe usbtest alt=1
>> <device> modprobe g_zero
>> plug device to SuperSpeed port on the host.
> 
>> Without this patch the host always complains like so
>> "usb 12-2: Not enough bandwidth for new device state.
>>   usb 12-2: Not enough bandwidth for altsetting 1"
> 
>> Bug was introduced by commit cf9a08ae in v3.9
> 
>    Please also specify that commit's summary in parens. Also, there's now an adopted standard way of saying this:
> 
> Fixes: <12-digit SHA ID> ("<summary line>")
> 
Right. will send a v2. Thanks.

cheers,
-roger
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch

diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
index 9f170c5..134f354 100644
--- a/drivers/usb/gadget/zero.c
+++ b/drivers/usb/gadget/zero.c
@@ -300,7 +300,7 @@  static int __init zero_bind(struct usb_composite_dev *cdev)
 	ss_opts->isoc_interval = gzero_options.isoc_interval;
 	ss_opts->isoc_maxpacket = gzero_options.isoc_maxpacket;
 	ss_opts->isoc_mult = gzero_options.isoc_mult;
-	ss_opts->isoc_maxburst = gzero_options.isoc_maxpacket;
+	ss_opts->isoc_maxburst = gzero_options.isoc_maxburst;
 	ss_opts->bulk_buflen = gzero_options.bulk_buflen;
 
 	func_ss = usb_get_function(func_inst_ss);