public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] usb: dwc2: fix aligned buffer usage
Date: Sat, 07 Mar 2015 23:16:43 -0700	[thread overview]
Message-ID: <54FBE94B.5080804@wwwdotorg.org> (raw)
In-Reply-To: <1425794981-32621-1-git-send-email-swarren@wwwdotorg.org>

On 03/07/2015 11:09 PM, Stephen Warren wrote:
> The original aligned_buffer usage:
> a) Uselessly copied data into the aligned buffer even for IN
>    transactions.
> b) Needlessly split the memcpy() into separate calls per chunk, rather
>    than doing it all at once, as it did for the post-transfer copy for
>    IN transactions.
> c) Always programmed the HW to transfer to/from the start of the aligned
>    buffer, rather than the location of the start of the current chunk.
>    This worked fine for OUT transactions since the memcpy copied the data
>    to this location. However, for large IN transactions, it resulted in
>    each transfer over-writing the data for the first transfer.
> 
> This patch assumes that the USB maxpacket is at least 8, so that each
> chunk of the overall transfer is still aligned to the HW's 8-byte
> alignment requirement.

Hmm. Further investigation shows the maxpacket isn't restricted to nice
aligned values. For some reason I thought it was. I'll need to adjust
this patch. Time for sleep!

      reply	other threads:[~2015-03-08  6:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-08  6:09 [U-Boot] [PATCH] usb: dwc2: fix aligned buffer usage Stephen Warren
2015-03-08  6:16 ` Stephen Warren [this message]

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=54FBE94B.5080804@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --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