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 V2] usb: ci_udc: Allocate the qTD list directly
Date: Tue, 01 Jul 2014 17:10:24 -0600	[thread overview]
Message-ID: <53B33FE0.8060307@wwwdotorg.org> (raw)
In-Reply-To: <53B33CDE.8020206@posteo.de>

On 07/01/2014 04:57 PM, J?rg Krause wrote:
> 
> On 07/02/2014 12:51 AM, Stephen Warren wrote:
>> [...]
>>>      Loading: ##
>>>           4.3 MiB/s
>>>      done
>>>      Bytes transferred = 18003 (4653 hex)
>>>      CACHE: Misaligned operation at range [40008000, 4000c653]
>> OK, that particular error happens well after the network transfer phase
>> of the tftp command, so is likely nothing to do with ci_udc. It'd be
>> great if you could track it down and fix it though.
> 
> Oh, any idea where to look at?

My guess is common/cmd_net.c netboot_common() which does:

	/* flush cache */
	flush_cache(load_addr, size);

That seems pointless and wrong:

* The Ethernet driver should do any cache management it requires as part
of its low-level IO code, before copying the data to the load address.

* A cache flush after copying data into RAM seems pointless. A cache
*invalidate* /might/ make sense in some circumstances (e.g. after DMA
before CPU reads), but that's not the case here.

* The top-level TFTP code can't do the cache management, since it can't
be sure that the file length is an exact multiple of the cache line
size, and hence can't guarantee that cache management won't corrupt
other adjacent data. That's why the cache management must be performed
by the low-level network driver on its own aligned buffers.

In summary, I think we should remove that flush_cache() call, but I'm
not going to send a patch for that right before I go on vacation right
before a release...

  reply	other threads:[~2014-07-01 23:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 23:53 [U-Boot] [PATCH] usb: ci_udc: Allocate the qTD list directly Marek Vasut
2014-06-30 23:55 ` Marek Vasut
2014-07-01  0:04 ` [U-Boot] [PATCH V2] " Marek Vasut
2014-07-01  6:51   ` Jörg Krause
2014-07-01 10:17     ` Marek Vasut
2014-07-01 11:03       ` Jörg Krause
2014-07-01 11:19         ` Marek Vasut
2014-07-01 11:22           ` Jörg Krause
2014-07-01 11:35             ` Marek Vasut
2014-07-01 11:48               ` Jörg Krause
2014-07-01 22:34             ` Jörg Krause
2014-07-01 22:36               ` Stephen Warren
2014-07-01 22:47                 ` Jörg Krause
2014-07-01 22:51                   ` Stephen Warren
2014-07-01 22:57                     ` Jörg Krause
2014-07-01 23:10                       ` Stephen Warren [this message]
2014-07-01 15:03   ` Stephen Warren
2014-07-01 15:13     ` Marek Vasut
2014-07-01 15:16       ` Stephen Warren
2014-07-01 15:22         ` 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=53B33FE0.8060307@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