public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Frank Wang <frank.wang@rock-chips.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: Wed, 16 Dec 2015 10:39:16 +0800	[thread overview]
Message-ID: <000001d137aa$f5fa3ac0$e1eeb040$@rock-chips.com> (raw)
In-Reply-To: <20151207135826.1808bc41@amdc2363>

Hi Lukasz,

Sorry to reply you so late.

The issue occur at below case, I have also attached some logs.

fastboot_set_alt()--> usb_ep_enable(fs_ep_in) --> s3c_ep_enable()

=> 
=> fastboot 0
s3c_udc_probe: 9ffaf938
0
s3c_alloc_request: ep0-control 9ffb176c
Reseting OTG controller
0
0
Reseting OTG controller
0
0
0
nuke: ep0-control 9ffb176c
pkt = 8006000100004000 
0

*** s3c_queue: ep0-control-in req = 9df7adc0, len = 18, buf = 9df7cd80 empty
= 1, stopped = 0
pkt = 1201000202020040 0722060099990102 0301
0
done: ep0-control 9ffb176c, req = 9df7adc0, stopped = 0
calling complete callback
pkt[18] = 1201000202020040 0722060099990102 0301
callback completed
0
0
Reseting OTG controller
0
0
0
nuke: ep0-control 9ffb176c
pkt = 0005040000000000 
0
0
nuke: ep0-control 9ffb176c
pkt = 8006000100001200 
0

*** s3c_queue: ep0-control-in req = 9df7adc0, len = 18, buf = 9df7cd80 empty
= 1, stopped = 0
pkt = 1201000202020040 0722060099990102 0301
0
done: ep0-control 9ffb176c, req = 9df7adc0, stopped = 0
calling complete callback
pkt[18] = 1201000202020040 0722060099990102 0301
callback completed
0
0
nuke: ep0-control 9ffb176c
pkt = 800600020000ff00 
0

*** s3c_queue: ep0-control-in req = 9df7adc0, len = 32, buf = 9df7cd80 empty
= 1, stopped = 0
pkt = 09022000010102c0 000904000002ff42 0304070581024000 0007050202000200 
0
done: ep0-control 9ffb176c, req = 9df7adc0, stopped = 0
calling complete callback
pkt[32] = 09022000010102c0 000904000002ff42 0304070581024000
0007050202000200 
callback completed
0
0
nuke: ep0-control 9ffb176c
pkt = 800600030000ff00 
0

*** s3c_queue: ep0-control-in req = 9df7adc0, len = 4, buf = 9df7cd80 empty
= 1, stopped = 0
pkt = 04030904
0
done: ep0-control 9ffb176c, req = 9df7adc0, stopped = 0
calling complete callback
pkt[4] = 04030904
callback completed
0
0
nuke: ep0-control 9ffb176c
pkt = 8006000100001200 
0

*** s3c_queue: ep0-control-in req = 9df7adc0, len = 18, buf = 9df7cd80 empty
= 1, stopped = 0
pkt = 1201000202020040 0722060099990102 0301
0
done: ep0-control 9ffb176c, req = 9df7adc0, stopped = 0
calling complete callback
pkt[18] = 1201000202020040 0722060099990102 0301
callback completed
0
0
nuke: ep0-control 9ffb176c
pkt = 8006000100001200 
0

*** s3c_queue: ep0-control-in req = 9df7adc0, len = 18, buf = 9df7cd80 empty
= 1, stopped = 0
pkt = 1201000202020040 0722060099990102 0301
0
done: ep0-control 9ffb176c, req = 9df7adc0, stopped = 0
calling complete callback
pkt[18] = 1201000202020040 0722060099990102 0301
callback completed
0
0
nuke: ep0-control 9ffb176c
pkt = 8006000200000900 
0

*** s3c_queue: ep0-control-in req = 9df7adc0, len = 9, buf = 9df7cd80 empty
= 1, stopped = 0
pkt = 09022000010102c0 00
0
done: ep0-control 9ffb176c, req = 9df7adc0, stopped = 0
calling complete callback
pkt[9] = 09022000010102c0 00
callback completed
0
0
nuke: ep0-control 9ffb176c
pkt = 8006000200002000 
0

*** s3c_queue: ep0-control-in req = 9df7adc0, len = 32, buf = 9df7cd80 empty
= 1, stopped = 0
pkt = 09022000010102c0 000904000002ff42 0304070581024000 0007050202000200 
0
done: ep0-control 9ffb176c, req = 9df7adc0, stopped = 0
calling complete callback
pkt[32] = 09022000010102c0 000904000002ff42 0304070581024000
0007050202000200 
callback completed
0
0
nuke: ep0-control 9ffb176c
pkt = 8000000000000200 
crq->brequest:0x0
0
0
0
nuke: ep0-control 9ffb176c
pkt = 0009010000000000 
fastboot_set_alt: func: f_fastboot intf: 0 alt: 0
s3c_ep_enable: 9ffb1804
s3c_udc_set_nak: ep_num = 2, ep_type = 1
s3c_udc_set_nak: set NAK, DOEPCTL2 = 0x40020000
s3c_udc_set_halt: ep_num = 2, value = 0
0
s3c_udc_ep_clear_stall: ep_num = 2, ep_type = 1
s3c_udc_ep_clear_stall: cleared stall, DOEPCTL2 = 0x40020000
0
s3c_udc_ep_activate: EPCTRL2 = 0x40020000, ep_is_in = 0
s3c_udc_ep_activate: USB Ative EP2, DOEPCTRL2 = 0x400a8200
s3c_udc_ep_activate: DAINTMSK = 0x50001
s3c_ep_enable: enabled ep2out-bulk, stopped = 0, maxpacket = 512
s3c_alloc_request: ep2out-bulk 9ffb1804
s3c_ep_enable: 9ffb17b8
s3c_ep_enable: desc->wMaxPacketSize=64, ep->maxpacket=512
s3c_ep_enable: bad ep1in-bulk maxpacket
failed to enable in ep
s3c_ep_disable: 9ffb1804
0
nuke: ep2out-bulk 9ffb1804
s3c_ep_disable: disabled ep2out-bulk
s3c_ep_disable: 9ffb17b8
s3c_ep_disable: ep1in-bulk not enabled
s3c_free_request: 9ffb1804
s3c_ep_disable: 9ffb1804
s3c_ep_disable: ep2out-bulk not enabled
s3c_ep_disable: 9ffb17b8
s3c_ep_disable: ep1in-bulk not enabled
0
nuke: ep0-control 9ffb176c
pkt = 8006000100001200 
0


BR.
Frank
-----????-----
???: Lukasz Majewski [mailto:l.majewski at samsung.com] 
????: 2015?12?7? 20:58
???: Frank Wang
??: marex at denx.de; trini at konsulko.com; u-boot at lists.denx.de;
benchan at chromium.org; kmixter at chromium.org; sjg at chromium.org; cf at rock-chips.
com
??: Re: [PATCH 1/2] usb: gadget: s3c_udc_otg: fixed max packet size check
for ep_in in high speed

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-16  2:39 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
2015-12-16  2:39     ` Frank Wang [this message]
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='000001d137aa$f5fa3ac0$e1eeb040$@rock-chips.com' \
    --to=frank.wang@rock-chips.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