public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot]  question regarding USB gadget driver (dwc2)
@ 2016-01-27  0:35 Steve Rae
  2016-01-27  1:35 ` Marek Vasut
  0 siblings, 1 reply; 6+ messages in thread
From: Steve Rae @ 2016-01-27  0:35 UTC (permalink / raw)
  To: u-boot

Hi Marek & Lukasz,


I have an issue running fastboot on my board (which is USB_SPEED_HIGH):

    => fastboot0

    failed to enable in ep

    failed to enable in ep

    failed to enable in ep

Because of this, fastboot does not even initialize properly, and I need 
to "^C" to break out?

I have traced this the following code in 
"drivers/usb/gadget/dwc2_udc_otg.c":

    559/* hardware _could_ do smaller, but driver doesn't */

    560if ((desc->bmAttributes== USB_ENDPOINT_XFER_BULK

    561&& le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)) !=

    562ep_maxpacket(ep)) || !get_unaligned(&desc->wMaxPacketSize)) {

    563

    564debug("%s: bad %s maxpacket\n", __func__, _ep->name);

    565return -ERANGE;

    566}

    567

    568dev= ep->dev;

    569if (!dev->driver || dev->gadget.speed== USB_SPEED_UNKNOWN) {

    570

    571debug("%s: bogus device state\n", __func__);

    572return -ESHUTDOWN;

    573}

    574

    575ep->stopped = 0;

    576ep->desc= desc;

    577ep->pio_irqs= 0;

    578ep->ep.maxpacket= le16_to_cpu(get_unaligned(&desc->wMaxPacketSize));

The error message is because:

    line 561 wMaxPacketSize= 64, and

    line 562 ep_maxpacket(ep) = 512

I am questioning this logic, because at line 578, the ep.maxpacket is 
being changed to the wMaxPacketSize anyway!


I am uncertain how to proceed - please advise!

Thanks in advance, Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] question regarding USB gadget driver (dwc2)
  2016-01-27  0:35 [U-Boot] question regarding USB gadget driver (dwc2) Steve Rae
@ 2016-01-27  1:35 ` Marek Vasut
  2016-01-27  1:58   ` Steve Rae
  0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2016-01-27  1:35 UTC (permalink / raw)
  To: u-boot

On Wednesday, January 27, 2016 at 01:35:55 AM, Steve Rae wrote:
> Hi Marek & Lukasz,
> 
> 
> I have an issue running fastboot on my board (which is USB_SPEED_HIGH):
> 
>     => fastboot0
> 
>     failed to enable in ep
> 
>     failed to enable in ep
> 
>     failed to enable in ep
> 
> Because of this, fastboot does not even initialize properly, and I need
> to "^C" to break out?
> 
> I have traced this the following code in
> "drivers/usb/gadget/dwc2_udc_otg.c":

I will have to delegate this onto Lukasz, since he's the s3c gadget expert.

Take a look at:
[PATCH 1/2] usb: gadget: s3c_udc_otg: fixed max packet size check for ep_in in 
high speed

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] question regarding USB gadget driver (dwc2)
  2016-01-27  1:35 ` Marek Vasut
@ 2016-01-27  1:58   ` Steve Rae
  2016-01-27  2:11     ` Marek Vasut
  2016-01-29 16:40     ` Lukasz Majewski
  0 siblings, 2 replies; 6+ messages in thread
From: Steve Rae @ 2016-01-27  1:58 UTC (permalink / raw)
  To: u-boot



On 16-01-26 05:35 PM, Marek Vasut wrote:
> On Wednesday, January 27, 2016 at 01:35:55 AM, Steve Rae wrote:
>> Hi Marek & Lukasz,
>>
>>
>> I have an issue running fastboot on my board (which is USB_SPEED_HIGH):
>>
>>      => fastboot0
>>
>>      failed to enable in ep
>>
>>      failed to enable in ep
>>
>>      failed to enable in ep
>>
>> Because of this, fastboot does not even initialize properly, and I need
>> to "^C" to break out?
>>
>> I have traced this the following code in
>> "drivers/usb/gadget/dwc2_udc_otg.c":
>
> I will have to delegate this onto Lukasz, since he's the s3c gadget expert.
>
> Take a look at:
> [PATCH 1/2] usb: gadget: s3c_udc_otg: fixed max packet size check for ep_in in
> high speed
>
> Best regards,
> Marek Vasut
>
yes - I think that 'patchwork.ozlabs.org/patch/560029' would resolve my 
issue
Thanks, Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] question regarding USB gadget driver (dwc2)
  2016-01-27  1:58   ` Steve Rae
@ 2016-01-27  2:11     ` Marek Vasut
  2016-01-29 16:40     ` Lukasz Majewski
  1 sibling, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2016-01-27  2:11 UTC (permalink / raw)
  To: u-boot

On Wednesday, January 27, 2016 at 02:58:38 AM, Steve Rae wrote:
> On 16-01-26 05:35 PM, Marek Vasut wrote:
> > On Wednesday, January 27, 2016 at 01:35:55 AM, Steve Rae wrote:
> >> Hi Marek & Lukasz,
> >> 
> >> I have an issue running fastboot on my board (which is USB_SPEED_HIGH):
> >>      => fastboot0
> >>      
> >>      failed to enable in ep
> >>      
> >>      failed to enable in ep
> >>      
> >>      failed to enable in ep
> >> 
> >> Because of this, fastboot does not even initialize properly, and I need
> >> to "^C" to break out?
> >> 
> >> I have traced this the following code in
> > 
> >> "drivers/usb/gadget/dwc2_udc_otg.c":
> > I will have to delegate this onto Lukasz, since he's the s3c gadget
> > expert.
> > 
> > Take a look at:
> > [PATCH 1/2] usb: gadget: s3c_udc_otg: fixed max packet size check for
> > ep_in in high speed
> > 
> > Best regards,
> > Marek Vasut
> 
> yes - I think that 'patchwork.ozlabs.org/patch/560029' would resolve my
> issue

Can you please resubmit that patch if it helps so it finally gets in ?
Thanks

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] question regarding USB gadget driver (dwc2)
  2016-01-27  1:58   ` Steve Rae
  2016-01-27  2:11     ` Marek Vasut
@ 2016-01-29 16:40     ` Lukasz Majewski
  2016-01-29 18:19       ` Steve Rae
  1 sibling, 1 reply; 6+ messages in thread
From: Lukasz Majewski @ 2016-01-29 16:40 UTC (permalink / raw)
  To: u-boot

Hi Steve,

> 
> 
> On 16-01-26 05:35 PM, Marek Vasut wrote:
> > On Wednesday, January 27, 2016 at 01:35:55 AM, Steve Rae wrote:
> >> Hi Marek & Lukasz,
> >>
> >>
> >> I have an issue running fastboot on my board (which is
> >> USB_SPEED_HIGH):
> >>
> >>      => fastboot0
> >>
> >>      failed to enable in ep
> >>
> >>      failed to enable in ep
> >>
> >>      failed to enable in ep
> >>
> >> Because of this, fastboot does not even initialize properly, and I
> >> need to "^C" to break out?
> >>
> >> I have traced this the following code in
> >> "drivers/usb/gadget/dwc2_udc_otg.c":
> >
> > I will have to delegate this onto Lukasz, since he's the s3c gadget
> > expert.
> >
> > Take a look at:
> > [PATCH 1/2] usb: gadget: s3c_udc_otg: fixed max packet size check
> > for ep_in in high speed
> >
> > Best regards,
> > Marek Vasut
> >
> yes - I think that 'patchwork.ozlabs.org/patch/560029' would resolve
> my issue
> Thanks, Steve
> 

Ok, I see the point. The above patch should not bring any regression,
since if MPS < maxpacket(ep), then we will set the descriptor's
wMaxPacketSize as ep->ep.maxpacket.

I'm just wondering if you could share the wMaxPacketSize of your
platform (lsusb -v on HOST).

In my case it is:
wMaxPacketSize     0x0200  1x 512 bytes



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] question regarding USB gadget driver (dwc2)
  2016-01-29 16:40     ` Lukasz Majewski
@ 2016-01-29 18:19       ` Steve Rae
  0 siblings, 0 replies; 6+ messages in thread
From: Steve Rae @ 2016-01-29 18:19 UTC (permalink / raw)
  To: u-boot

Hi Lukasz,

On 16-01-29 08:40 AM, Lukasz Majewski wrote:
> Hi Steve,
>
>>
>>
>> On 16-01-26 05:35 PM, Marek Vasut wrote:
>>> On Wednesday, January 27, 2016 at 01:35:55 AM, Steve Rae wrote:
>>>> Hi Marek & Lukasz,
>>>>
>>>>
>>>> I have an issue running fastboot on my board (which is
>>>> USB_SPEED_HIGH):
>>>>
>>>>       => fastboot0
>>>>
>>>>       failed to enable in ep
>>>>
>>>>       failed to enable in ep
>>>>
>>>>       failed to enable in ep
>>>>
>>>> Because of this, fastboot does not even initialize properly, and I
>>>> need to "^C" to break out?
>>>>
>>>> I have traced this the following code in
>>>> "drivers/usb/gadget/dwc2_udc_otg.c":
>>>
>>> I will have to delegate this onto Lukasz, since he's the s3c gadget
>>> expert.
>>>
>>> Take a look at:
>>> [PATCH 1/2] usb: gadget: s3c_udc_otg: fixed max packet size check
>>> for ep_in in high speed
>>>
>>> Best regards,
>>> Marek Vasut
>>>
>> yes - I think that 'patchwork.ozlabs.org/patch/560029' would resolve
>> my issue
>> Thanks, Steve
>>
>
> Ok, I see the point. The above patch should not bring any regression,
> since if MPS < maxpacket(ep), then we will set the descriptor's
> wMaxPacketSize as ep->ep.maxpacket.
>
> I'm just wondering if you could share the wMaxPacketSize of your
> platform (lsusb -v on HOST).
>
> In my case it is:
> wMaxPacketSize     0x0200  1x 512 bytes
>
>
>

on host: lsusb -v
[... snip ...]
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x81  EP 1 IN
         bmAttributes            2
           Transfer Type            Bulk
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0040  1x 64 bytes
         bInterval               0
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x02  EP 2 OUT
         bmAttributes            2
           Transfer Type            Bulk
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0200  1x 512 bytes
         bInterval               0
[... snip ...]

Thanks, Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-29 18:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-27  0:35 [U-Boot] question regarding USB gadget driver (dwc2) Steve Rae
2016-01-27  1:35 ` Marek Vasut
2016-01-27  1:58   ` Steve Rae
2016-01-27  2:11     ` Marek Vasut
2016-01-29 16:40     ` Lukasz Majewski
2016-01-29 18:19       ` Steve Rae

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox