public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] lib_ppc: rework the flush_cache
Date: Tue, 02 Dec 2008 12:13:26 -0600	[thread overview]
Message-ID: <49357AC6.1000209@freescale.com> (raw)
In-Reply-To: <1228189677-5348-1-git-send-email-daveliu@freescale.com>

Dave Liu wrote:
> - It is possible to miss flush/invalidate the last
>   cache line, we fix it at here.

That comment was on the version you posted in the NAND patch; the 
lib_ppc version actually looks worse -- it tried to round down to avoid 
the issue, but it was missing a ~.  Thus, it flushed everything from 
address 0 to the end.

> +	start = start_addr & ~(CONFIG_SYS_CACHELINE_SIZE - 1);
> +	end = (start_addr + size) & ~(CONFIG_SYS_CACHELINE_SIZE - 1);

end = start_addr + size - 1;

The rounding is unnecessary for end, and without the - 1, if start_addr 
+ size is on a cacheline boundary, you'll flush one cache line too many 
(which might not be mapped, or might cause end to wrap around to zero if 
flushing at the end of the address space).

-Scott

  reply	other threads:[~2008-12-02 18:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02  3:47 [U-Boot] [PATCH] lib_ppc: rework the flush_cache Dave Liu
2008-12-02 18:13 ` Scott Wood [this message]
2008-12-03 12:56   ` Liu Dave
2008-12-14 11:48     ` Wolfgang Denk
     [not found] <79C363B768933F4FB918025FF7EB888856A042@zch01exm21.fsl.freescale.net>
2008-12-03 16:33 ` Scott Wood
2008-12-03 23:23   ` Liu Dave

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=49357AC6.1000209@freescale.com \
    --to=scottwood@freescale.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