From: Jerry Van Baren <gerald.vanbaren@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] powerpc flush_cache() roll over bug
Date: Fri, 06 Feb 2009 08:59:53 -0500 [thread overview]
Message-ID: <498C4259.2080904@ge.com> (raw)
In-Reply-To: <9EFEF05A-9413-4DF9-9C0F-D6A2D77A401D@kernel.crashing.org>
Kumar Gala wrote:
> My brian stopped working but I figured I'd send my issue and hopefully
> I'll wake up and someone will have a solution for me.
Talk about sweet dreams! :-D
> The problem is we can call flush_cache(0xfffff000, 0x1000) which will
> never exit the loop:
>
> void flush_cache(ulong start_addr, ulong size)
> {
> #ifndef CONFIG_5xx
> ulong addr, start;
> u64 end;
>
> start = start_addr & ~(CONFIG_SYS_CACHELINE_SIZE - 1);
> end = start_addr + size - 1;
>
> for (addr = start; addr <= end; addr +=
> CONFIG_SYS_CACHELINE_SIZE) {
> asm volatile("dcbst 0,%0" : : "r" (addr) : "memory");
> WATCHDOG_RESET();
> }
> ...
>
> since end = 0xffffffff. There are some other situations (like
> flush_cache(0, 0)) that cause similar issues, but less concerned about
> that.
>
> Any suggestions on how to best to re-write the code to correctly
> handle flush_cache(0xfffff000, 0x1000) are welcome.
You could do a range check between start and end:
for (addr = start;
(addr <= end) && (addr >= start);
addr += CONFIG_SYS_CACHELINE_SIZE) {
Best regards,
gvb
next prev parent reply other threads:[~2009-02-06 13:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-06 6:04 [U-Boot] powerpc flush_cache() roll over bug Kumar Gala
2009-02-06 13:59 ` Jerry Van Baren [this message]
2009-02-06 14:07 ` Kumar Gala
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=498C4259.2080904@ge.com \
--to=gerald.vanbaren@ge.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.