All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] usb: s3c-otg: Fix short packet for request size > ep.maxpacket
Date: Tue, 19 Apr 2016 13:21:55 +0300	[thread overview]
Message-ID: <571606C3.1060503@ti.com> (raw)
In-Reply-To: <20160419110243.577c277a@amdc2363>

Hi Lukasz,

On 19/04/16 12:02, Lukasz Majewski wrote:
> Hi Roger,
> 
>> Request size can be greater than ep.packet and still end in a
>> short packet. We need to tackle this case as end of transfer
>> (if short_not_ok is not set) as indicated in USB 2.0 Specification
>> [1], else we get stuck up on certain protocols like fastboot.
>>
>> [1] - USB2.0 Specification, Section 5.3.2 Pipes
>>
>> Reported-by: Steve Rae <steve.rae@broadcom.com>
>> Signed-off-by: Roger Quadros <rogerq@ti.com>
>> Tested-by: Steve Rae <steve.rae@broadcom.com>
>> ---
>>  drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
>> b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c index bce9c30..a31d875
>> 100644 --- a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
>> +++ b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
>> @@ -229,7 +229,7 @@ static void complete_rx(struct dwc2_udc *dev, u8
>> ep_num) ROUND(xfer_size, CONFIG_SYS_CACHELINE_SIZE));
>>  
>>  	req->req.actual += min(xfer_size, req->req.length -
>> req->req.actual);
>> -	is_short = (xfer_size < ep->ep.maxpacket);
>> +	is_short = xfer_size % ep->ep.maxpacket;
> 
> is_short is a flag - so maybe it would be better to write something
> like:

but it is defined as u32 so I thought it might as well print the
short packet length instead of just 1/0.

> 
> is_short = !!(xfer_size % ep->ep.maxpacket)) ?
> 
> I'm going to test those patches on my boards. I will share the results
> ASAP.
> 
>>  
>>  	debug_cond(DEBUG_OUT_EP != 0,
>>  		   "%s: RX DMA done : ep = %d, rx bytes = %d/%d, "
> 
> 
> 

--
cheers,
-roger

  reply	other threads:[~2016-04-19 10:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19  7:16 [U-Boot] [PATCH 0/3] s3c-otg: fastboot: fixes and cleanup Roger Quadros
2016-04-19  7:16 ` [U-Boot] [PATCH 1/3] fastboot: Clean up bulk-out logic Roger Quadros
2016-04-19  9:00   ` Lukasz Majewski
2016-04-21 10:03   ` Lukasz Majewski
2016-04-22  2:59     ` Steve Rae
2016-04-22  3:52       ` Lukasz Majewski
2016-04-19  7:17 ` [U-Boot] [PATCH 2/3] usb: s3c-otg: Fix short packet for request size > ep.maxpacket Roger Quadros
2016-04-19  9:02   ` Lukasz Majewski
2016-04-19 10:21     ` Roger Quadros [this message]
2016-04-19 11:25       ` Lukasz Majewski
2016-04-19 11:52         ` Roger Quadros
2016-04-19 12:20   ` [U-Boot] [PATCH v2 " Roger Quadros
2016-04-21 10:04     ` Lukasz Majewski
2016-04-19  7:17 ` [U-Boot] [PATCH 3/3] usb: s3c-otg: Fix remaining bytes in debug messages Roger Quadros
2016-04-21 10:05   ` Lukasz Majewski
2016-04-22  2:49     ` Steve Rae
2016-04-22  3:03       ` Steve Rae

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=571606C3.1060503@ti.com \
    --to=rogerq@ti.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 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.