public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] ELF_RELOC causes strange I-cache issues
Date: Wed, 20 Oct 2010 22:12:07 +0200	[thread overview]
Message-ID: <4CBF4D17.6020403@free.fr> (raw)
In-Reply-To: <20101020184930.E89F7136320@gemini.denx.de>

Le 20/10/2010 20:49, Wolfgang Denk a ?crit :
> Hello everybody,
>
> after nailing down a few USB and FAT related bugs we had USB running
> stable on i.MX31, but suddenly the current mainline code behaves
> strangely again:
>
> Repeating simple calls like "usb read 80800000 0 1000" will reliably
> hard hang the system after 3...5 calls.
>
> The problem can be avoided by switching off the instruction cache
> (using the "icache off" command).
>
>
> Trying to track down this problem it turns out that somehow the
> ELF_RELOC patches seem to be responsible for it.  I have a source tree
> that works perfectly fine, with I-caches on, and after cherry-picking
> the following commits from the elf_reloc branch the problem appears:
>
> 92d5ecb   2010-10-13 10:10:21   arm: implement ELF relocations
> bafe743   2010-10-13 10:12:52   arm1136, qong: add support for ELF relocations
>
> However, we cannot find a real cause in the modified code.
>
>
> Here my request for help:
>
> - Has anybody experienced similar problems?
>
> - Did your tests of the elf_reloc code include any thorough testing
>    of USB mass storage devices?
>
> - If you have any suitable hardware around, could you please run a few
>    such tests (as mentioned above, a simple "usb read<addr>  0 1000",
>    repeated 5 times or so, should be sufficient. If you want to be
>    sure, increase the block count and repeat more often.
>
>
> All ideas welcome.  Thanks a lot in advance.
>
> Best regards,
>
> Wolfgang Denk

Is the data cache on or off when you experience the issue? If it was on, 
can you try with data cache off and instruction cache on?

If the issue arises when both caches are on, then *maybe* the issue is 
caused by code which was loaded into i-cache *before* it was fixed up, 
or loaded while its fixups were still in the data cache. However this 
does not explain everything, since even with instruction cache off, data 
cache can hold fixups for some time and thus non-cached instruction 
fetches could return the wrong code.

Still, since ELF fixups are some sort of code self-modification, they 
must, according to the ARM doc, be followed by an IMB sequence. The 
exact sequence varies; I will look up and provide the sequence for 
ARM1136 tomorrow -- unless someone else can do it sooner, of course.

Amicalement,
-- 
Albert.

  reply	other threads:[~2010-10-20 20:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-20 18:49 [U-Boot] ELF_RELOC causes strange I-cache issues Wolfgang Denk
2010-10-20 20:12 ` Albert ARIBAUD [this message]
2010-10-20 20:54   ` Wolfgang Denk
2010-10-20 22:20     ` Joakim Tjernlund
2010-10-21  9:18     ` Albert Aribaud
2010-10-21  9:51       ` Heiko Schocher
2010-10-21 10:11         ` Reinhard Meyer
2010-10-21 10:34           ` Albert ARIBAUD
2010-10-21 10:49             ` Reinhard Meyer
2010-10-21 10:50             ` Heiko Schocher
2010-10-21 11:03             ` Stefan Roese
2010-10-21 10:54           ` Wolfgang Denk
2010-10-21 10:56         ` Albert ARIBAUD
2010-10-21 11:36           ` Wolfgang Denk
2010-10-21 11:45             ` Wolfgang Denk
2010-10-21 11:52               ` Stefano Babic
2010-10-21 11:53           ` Wolfgang Denk
2010-10-21 12:00           ` Wolfgang Denk
2010-10-21 12:53             ` Albert ARIBAUD
2010-10-21 11:28         ` Joakim Tjernlund
2010-10-21 10:05       ` Wolfgang Denk
2010-10-22 12:23 ` [U-Boot] [PATCH] ehci-hcd.c: fix hanging under higher load Wolfgang Denk
2010-10-22 19:51   ` Remy Bohmer
2010-10-22 12:26 ` [U-Boot] ELF_RELOC causes strange I-cache issues Wolfgang Denk
2010-10-22 13:19   ` Albert ARIBAUD
2010-10-22 13:28     ` Wolfgang Denk

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=4CBF4D17.6020403@free.fr \
    --to=albert.aribaud@free.fr \
    --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