All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH][RE-SUBMIT] usb: gadget: dwc2_udc_otg: modified the check condition for max packet size of ep_in in high speed
@ 2016-01-27 20:39 Steve Rae
  2016-01-27 20:47 ` Marek Vasut
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Steve Rae @ 2016-01-27 20:39 UTC (permalink / raw)
  To: u-boot

From: Frank Wang <frank.wang@rock-chips.com>

In current high speed fastboot, fs_ep_in.wMaxPacketSize is configured 64 bytes
as default, as a result, it failed to match the size at initialization stage in
usb controller.
Actually, hardware can support less than or equal to 512 bytes in high speed mode,
so I changed the condition from  '!=' to '>' to fix this issue.

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Tested-by: Steve Rae <srae@broadcom.com>
---

 drivers/usb/gadget/dwc2_udc_otg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c
index 90ed5ff..19d6dcd 100644
--- a/drivers/usb/gadget/dwc2_udc_otg.c
+++ b/drivers/usb/gadget/dwc2_udc_otg.c
@@ -565,8 +565,8 @@ static int dwc2_ep_enable(struct usb_ep *_ep,
 	}
 
 	/* hardware _could_ do smaller, but driver doesn't */
-	if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK
-	     && le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)) !=
+	if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK &&
+	     le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)) >
 	     ep_maxpacket(ep)) || !get_unaligned(&desc->wMaxPacketSize)) {
 
 		debug("%s: bad %s maxpacket\n", __func__, _ep->name);
-- 
1.8.5

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

* [U-Boot] [PATCH][RE-SUBMIT] usb: gadget: dwc2_udc_otg: modified the check condition for max packet size of ep_in in high speed
  2016-01-27 20:39 [U-Boot] [PATCH][RE-SUBMIT] usb: gadget: dwc2_udc_otg: modified the check condition for max packet size of ep_in in high speed Steve Rae
@ 2016-01-27 20:47 ` Marek Vasut
  2016-01-28  8:18 ` Lukasz Majewski
  2016-01-29 16:42 ` Lukasz Majewski
  2 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2016-01-27 20:47 UTC (permalink / raw)
  To: u-boot

On Wednesday, January 27, 2016 at 09:39:40 PM, Steve Rae wrote:
> From: Frank Wang <frank.wang@rock-chips.com>
> 
> In current high speed fastboot, fs_ep_in.wMaxPacketSize is configured 64
> bytes as default, as a result, it failed to match the size at
> initialization stage in usb controller.
> Actually, hardware can support less than or equal to 512 bytes in high
> speed mode, so I changed the condition from  '!=' to '>' to fix this
> issue.
> 
> Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
> Tested-by: Steve Rae <srae@broadcom.com>
> ---

Applied, thanks.

Best regards,
Marek Vasut

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

* [U-Boot] [PATCH][RE-SUBMIT] usb: gadget: dwc2_udc_otg: modified the check condition for max packet size of ep_in in high speed
  2016-01-27 20:39 [U-Boot] [PATCH][RE-SUBMIT] usb: gadget: dwc2_udc_otg: modified the check condition for max packet size of ep_in in high speed Steve Rae
  2016-01-27 20:47 ` Marek Vasut
@ 2016-01-28  8:18 ` Lukasz Majewski
  2016-01-29 16:42 ` Lukasz Majewski
  2 siblings, 0 replies; 5+ messages in thread
From: Lukasz Majewski @ 2016-01-28  8:18 UTC (permalink / raw)
  To: u-boot

Hi Steve,

> From: Frank Wang <frank.wang@rock-chips.com>
> 
> In current high speed fastboot, fs_ep_in.wMaxPacketSize is configured
> 64 bytes as default, as a result, it failed to match the size at
> initialization stage in usb controller.
> Actually, hardware can support less than or equal to 512 bytes in
> high speed mode, so I changed the condition from  '!=' to '>' to fix
> this issue.

I'm aware of this problem, however now I'm busy with fixing dfu issue
regarding sending large files (e.g. 26 MiB). Patches are under
testing now.

After sending them I'll fix the fastboot problem.

> 
> Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
> Tested-by: Steve Rae <srae@broadcom.com>
> ---
> 
>  drivers/usb/gadget/dwc2_udc_otg.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/dwc2_udc_otg.c
> b/drivers/usb/gadget/dwc2_udc_otg.c index 90ed5ff..19d6dcd 100644
> --- a/drivers/usb/gadget/dwc2_udc_otg.c
> +++ b/drivers/usb/gadget/dwc2_udc_otg.c
> @@ -565,8 +565,8 @@ static int dwc2_ep_enable(struct usb_ep *_ep,
>  	}
>  
>  	/* hardware _could_ do smaller, but driver doesn't */
> -	if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK
> -	     && le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)) !=
> +	if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK &&
> +	     le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)) >
>  	     ep_maxpacket(ep))
> || !get_unaligned(&desc->wMaxPacketSize)) { 
>  		debug("%s: bad %s maxpacket\n", __func__, _ep->name);



-- 
Best regards,

Lukasz Majewski

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

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

* [U-Boot] [PATCH][RE-SUBMIT] usb: gadget: dwc2_udc_otg: modified the check condition for max packet size of ep_in in high speed
  2016-01-27 20:39 [U-Boot] [PATCH][RE-SUBMIT] usb: gadget: dwc2_udc_otg: modified the check condition for max packet size of ep_in in high speed Steve Rae
  2016-01-27 20:47 ` Marek Vasut
  2016-01-28  8:18 ` Lukasz Majewski
@ 2016-01-29 16:42 ` Lukasz Majewski
  2016-01-29 20:35   ` Marek Vasut
  2 siblings, 1 reply; 5+ messages in thread
From: Lukasz Majewski @ 2016-01-29 16:42 UTC (permalink / raw)
  To: u-boot

Hi Steve,

> From: Frank Wang <frank.wang@rock-chips.com>
> 
> In current high speed fastboot, fs_ep_in.wMaxPacketSize is configured
> 64 bytes as default, as a result, it failed to match the size at
> initialization stage in usb controller.
> Actually, hardware can support less than or equal to 512 bytes in
> high speed mode, so I changed the condition from  '!=' to '>' to fix
> this issue.
> 
> Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
> Tested-by: Steve Rae <srae@broadcom.com>
> ---
> 
>  drivers/usb/gadget/dwc2_udc_otg.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/dwc2_udc_otg.c
> b/drivers/usb/gadget/dwc2_udc_otg.c index 90ed5ff..19d6dcd 100644
> --- a/drivers/usb/gadget/dwc2_udc_otg.c
> +++ b/drivers/usb/gadget/dwc2_udc_otg.c
> @@ -565,8 +565,8 @@ static int dwc2_ep_enable(struct usb_ep *_ep,
>  	}
>  
>  	/* hardware _could_ do smaller, but driver doesn't */
> -	if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK
> -	     && le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)) !=
> +	if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK &&
> +	     le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)) >
>  	     ep_maxpacket(ep))
> || !get_unaligned(&desc->wMaxPacketSize)) { 
>  		debug("%s: bad %s maxpacket\n", __func__, _ep->name);

Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>

Test HW: Trats - Exynos4210 (dwc2 udc controller).

@Marek: 

Should I pick this patch or will you take it?

-- 
Best regards,

Lukasz Majewski

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

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

* [U-Boot] [PATCH][RE-SUBMIT] usb: gadget: dwc2_udc_otg: modified the check condition for max packet size of ep_in in high speed
  2016-01-29 16:42 ` Lukasz Majewski
@ 2016-01-29 20:35   ` Marek Vasut
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2016-01-29 20:35 UTC (permalink / raw)
  To: u-boot

On Friday, January 29, 2016 at 05:42:31 PM, Lukasz Majewski wrote:
> Hi Steve,
> 
> > From: Frank Wang <frank.wang@rock-chips.com>
> > 
> > In current high speed fastboot, fs_ep_in.wMaxPacketSize is configured
> > 64 bytes as default, as a result, it failed to match the size at
> > initialization stage in usb controller.
> > Actually, hardware can support less than or equal to 512 bytes in
> > high speed mode, so I changed the condition from  '!=' to '>' to fix
> > this issue.
> > 
> > Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
> > Tested-by: Steve Rae <srae@broadcom.com>
> > ---
> > 
> >  drivers/usb/gadget/dwc2_udc_otg.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/gadget/dwc2_udc_otg.c
> > b/drivers/usb/gadget/dwc2_udc_otg.c index 90ed5ff..19d6dcd 100644
> > --- a/drivers/usb/gadget/dwc2_udc_otg.c
> > +++ b/drivers/usb/gadget/dwc2_udc_otg.c
> > @@ -565,8 +565,8 @@ static int dwc2_ep_enable(struct usb_ep *_ep,
> > 
> >  	}
> >  	
> >  	/* hardware _could_ do smaller, but driver doesn't */
> > 
> > -	if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK
> > -	     && le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)) !=
> > +	if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK &&
> > +	     le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)) >
> > 
> >  	     ep_maxpacket(ep))
> > || 
> > || !get_unaligned(&desc->wMaxPacketSize)) {
> > || 
> >  		debug("%s: bad %s maxpacket\n", __func__, _ep->name);
> 
> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
> Tested-by: Lukasz Majewski <l.majewski@samsung.com>
> 
> Test HW: Trats - Exynos4210 (dwc2 udc controller).
> 
> @Marek:
> 
> Should I pick this patch or will you take it?

Pick it (and all the other udc stuff) and send me a PR please.

Best regards,
Marek Vasut

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-27 20:39 [U-Boot] [PATCH][RE-SUBMIT] usb: gadget: dwc2_udc_otg: modified the check condition for max packet size of ep_in in high speed Steve Rae
2016-01-27 20:47 ` Marek Vasut
2016-01-28  8:18 ` Lukasz Majewski
2016-01-29 16:42 ` Lukasz Majewski
2016-01-29 20:35   ` Marek Vasut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.