From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_CLEAN_INVAL_ALL) with asm code
Date: Wed, 6 Apr 2016 17:22:25 +0200 [thread overview]
Message-ID: <570529B1.5050300@redhat.com> (raw)
In-Reply-To: <20160406145103.GP23166@bill-the-cat>
Hi,
On 06-04-16 16:51, Tom Rini wrote:
> On Mon, Apr 04, 2016 at 08:31:48PM +0200, Hans de Goede wrote:
>
>> v7_maint_dcache_all() does not work reliable when build with gcc6,
>> see: https://bugzilla.redhat.com/show_bug.cgi?id=1318788
>>
>> While debugging this I learned that v7_maint_dcache_all() is unreliable
>> when build with gcc5 too when it is marked as noinline.
>>
>> This commit fixes the reliability issues by replacing the C-code with
>> the ready to use asm implementation from the kernel.
>>
>> Given that this code when written as C-code clearly is quite fragile
>> (also see the existing comments about the C-code being the way it is
>> to get optimal assembly) and that we have a proven asm alternative,
>> I believe that this is the best solution.
>>
>> Note that we actually already have a copy of the kernel's
>> v7_flush_dcache_all() in arch/arm/mach-uniphier/arm32/lowlevel_init.S.
>>
>> We should replace that implementation with a call to this one, but I'm
>> leaving this up to people with access to actual unifier hw. With this
>> replacement in mind I've kept the original function as is, only renamed
>> it to __v7_flush_dcache_all and v7_flush_dcache_all is a wrapper
>> saving the registered clobbered by the core __v7_flush_dcache_all code
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
> So I was able to talk with a few people and this is the right approach.
> The cache routines we're doing here in C must not in fact be done in C.
> That things work today with some compilers is not by design. This is at
> least a minimally correct thing to do and a more correct thing to do
> would be to leverage more of the code from the kernel for cache
> functions (and not just for v7).
Thanks! I guess that means that we can consider this issue resolved?
Which is good news as this was a nasty bug to track down.
So are you planning on merging this patch / these 2 patches to
master then ?
Note that in my testing only the first patch is necessary to fix
various sunxi boards no longer booting.
Regards,
Hans
next prev parent reply other threads:[~2016-04-06 15:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 18:31 [U-Boot] [PATCH 1/2] arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_CLEAN_INVAL_ALL) with asm code Hans de Goede
2016-04-04 18:31 ` [U-Boot] [PATCH 2/2] arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_INVAL_ALL) " Hans de Goede
2016-04-04 23:59 ` [U-Boot] [PATCH 1/2] arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_CLEAN_INVAL_ALL) " Tom Rini
2016-04-05 8:33 ` Hans de Goede
2016-04-05 8:44 ` Hans de Goede
2016-04-05 13:45 ` Tom Rini
2016-04-06 2:07 ` Masahiro Yamada
2016-04-06 14:51 ` Tom Rini
2016-04-06 15:22 ` Hans de Goede [this message]
2016-04-06 15:27 ` Tom Rini
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=570529B1.5050300@redhat.com \
--to=hdegoede@redhat.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.