From: "Eric Bénard" <eric@eukrea.com>
To: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [PATCH] usb: fix unaligned access
Date: Mon, 24 Oct 2011 21:42:43 +0200 [thread overview]
Message-ID: <4EA5BFB3.6030801@eukrea.com> (raw)
In-Reply-To: <20111024193042.GO23421@pengutronix.de>
Le 24/10/2011 21:30, Sascha Hauer a écrit :
> On Mon, Oct 24, 2011 at 09:02:53PM +0200, Eric Bénard wrote:
>> Hi,
>>
>> Le 24/10/2011 20:37, Fabian van der Werf a écrit :
>>>
>>> Okay, I think it may be a compiler problem. The latest code sourcery
>>> compiler builds a barebox that breaks on usb. 2009q1-203 builds fine,
>>> however.
>>>
>>> In the usb code the compiler should be able to figure out that the
>>> access is unaligned from the packed structure. So I guess it should
>>> split up the access in multiple loads/stores. I will look into the
>>> binaries to confirm this. The latest compiler may be broken or maybe
>>> the default behaviour has changed because armv7 actually supports
>>> unaligned access.
>>>
>> can't this be the same problem described here with gcc 4.6 :
>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/791552
>>
>> solved by this patch :
>> https://launchpadlibrarian.net/73908303/0001-USB-ehci-remove-structure-packing-from-ehci_def.patch
>>
>> with the following explanation :
>> The kernel source marks ehci_regs as packed. gcc 4.6 treats all
>> accesses to packed structures as unaligned and ends up reading the
>> status register multiple times.
>
> If Fabians compiler would treat every access to packed structure members
> as unaligned everything would be fine. The problem seems to be that it
> doesn't treat it as unaligned. Let's wait for Fabians binary analysis.
>
maybe the complete explanation will explain better the problem as barebox
seems to have the same readl as linux :
http://gcc.gnu.org/ml/gcc/2011-02/msg00035.html
Eric
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2011-10-24 19:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-22 13:19 Fabian van der Werf
2011-10-22 20:20 ` Sascha Hauer
2011-10-23 9:29 ` Fabian van der Werf
2011-10-24 15:14 ` Antony Pavlov
2011-10-24 17:07 ` Sascha Hauer
2011-10-24 18:37 ` Fabian van der Werf
2011-10-24 19:02 ` Eric Bénard
2011-10-24 19:30 ` Sascha Hauer
2011-10-24 19:42 ` Eric Bénard [this message]
2011-10-25 18:36 ` Fabian van der Werf
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=4EA5BFB3.6030801@eukrea.com \
--to=eric@eukrea.com \
--cc=barebox@lists.infradead.org \
/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