public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <l.majewski@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] usb: gadget: s3c_udc_otg: fixed max packet size check for ep_in in high speed
Date: Mon, 07 Dec 2015 13:58:26 +0100	[thread overview]
Message-ID: <20151207135826.1808bc41@amdc2363> (raw)
In-Reply-To: <1449221794-52246-2-git-send-email-frank.wang@rock-chips.com>

Hi Frank,

> In current fastboot frame, both full and high speed use 'fs_ep_in',
> but fs_ep_in.wMaxPacketSize is configurated 64 bytes as default,

Because 64 bytes is the smallest possible packet size. 

> I do not understand why high speed TX max packet size is also set as
> 64 bytes,

According to struct s3c_udc @ s3c_udc_otg.c only the EP0 has maxpacket
set to 64 bytes. Rest is set to 512B.

Frank could you shed some light on conditions when this error shows up?
Some logs/condition of operation could be helpful.

> so I changed the condition from  '!=' to '>' as a
> workaround.

Instead of applying workaround, lets focus on your problem.

> 
> Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
> ---
>  drivers/usb/gadget/s3c_udc_otg.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/s3c_udc_otg.c
> b/drivers/usb/gadget/s3c_udc_otg.c index 7a2d1e7..b2d3988 100644
> --- a/drivers/usb/gadget/s3c_udc_otg.c
> +++ b/drivers/usb/gadget/s3c_udc_otg.c
> @@ -556,8 +556,8 @@ static int s3c_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

  reply	other threads:[~2015-12-07 12:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04  9:36 [U-Boot] [PATCH 0/2] Rockchip: USB: added usb phy control to support fastboot Frank Wang
2015-12-04  9:36 ` [U-Boot] [PATCH 1/2] usb: gadget: s3c_udc_otg: fixed max packet size check for ep_in in high speed Frank Wang
2015-12-07 12:58   ` Lukasz Majewski [this message]
2015-12-16  2:39     ` [U-Boot] 答复: " Frank Wang
2015-12-04  9:36 ` [U-Boot] [PATCH 2/2] usb: gadget: add usb phy control to support fastboot for rk3036 Frank Wang
2015-12-04 18:32   ` Marek Vasut
2015-12-04 18:28 ` [U-Boot] [PATCH 0/2] Rockchip: USB: added usb phy control to support fastboot Marek Vasut
2015-12-19 20:30   ` Simon Glass
2015-12-19 21:23     ` Marek Vasut
2015-12-19 22:25       ` Simon Glass
2015-12-19 22:57         ` Marek Vasut
2015-12-21  3:04           ` Tom Rini
2015-12-21 10:17             ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151207135826.1808bc41@amdc2363 \
    --to=l.majewski@samsung.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox