From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: enable unaligned access on ARMv7
Date: Sat, 23 Jun 2012 11:01:13 +0200 [thread overview]
Message-ID: <20120623110113.511091c8@lilith> (raw)
In-Reply-To: <4FE4EE13.7040206@ti.com>
Hi Aneesh,
On Fri, 22 Jun 2012 15:13:39 -0700, Aneesh V <aneesh@ti.com> wrote:
> On 06/22/2012 03:11 PM, Aneesh V wrote:
> > +Tom
> >
> > Hi Lucas,
> >
> > On 06/22/2012 04:47 AM, Lucas Stach wrote:
> >> Hi Albert,
> >>
> >> Am Freitag, den 22.06.2012, 13:16 +0200 schrieb Albert ARIBAUD:
> >>> I am not too happy with enabling a lax behavior only to avoid an
> >>> issue which apparently is diagnosed and could / should be fixed at
> >>> its root. Can you point me to the relevant LKML thread
> >>> so that I get the details and understand what prevents fixing
> >>> this by 'simply' aligning the USB structures?
> >>
> >> I'm with you that the issue for this particular fault that I ran
> >> into should be fixed at it's root and I will do so as soon as I
> >> have enough time to do so, i.e. within the next three weeks.
> >> You can find a thread about this here:
> >> https://lkml.org/lkml/2011/4/27/278
From what I understand, the issue was not to allow unaligned access at
the hardware level, but to modify the attributes of the structure,
first by removing the packed attribute, then by reinstating the packed
attribute along with align(4).
> >> But apart from this, we certainly have situations where we have
> >> unaligned accesses that are justified and could not be removed.
> >> [...]
> >> I cannot see how enabling a hardware feature can be seen as
> >> allowing of lax behaviour. As some of the USB structs are used to
> >> access hardware registers, we can not align every struct there.
If the access is in true RAM, then we can always realign the data; and
I don't know of memory-mapped registers which would be unaligned wrt
their width. If some USB controller is designed so, then the fix should
only and explicitly affect that controller, because we don't know it it
will always be used with an ARM implementation that can do unaligned
accesses.
> > I think this issue was discussed before here(I haven't gone through
> > all the details of your problem, but it looks similar). And I think
> > Tom fixed this by wrapping the problematic accesses with
> > get/set_unaligned().
Could be a solution if the structures themselves cannot be fixed.
> > Please look at this thread, especially starting from my post
> > reporting the OMAP4 regression:
> > http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/113347/
Thanks for the reference. There seems to have been no confirmation that
the structures involved needed packing in the first place, and my
general opinion on packing structures is "DO NOT" -- if packing a
structure has an effect, it can alway be to de-align some field, which
barely makes sense as far as HW prgramming is concerned (I can only see
some point in packing a struct when you deal with network layer 7 data
in very special cases).
> BTW, I agree that enabling un-aligned access is not a bad idea.
Just being "not a bad idea" is not enough for me to accept this. It will
have to be the sole sound solution to a problem, and at this point, I
do not think it is as far as USB structure mis-alignement issues are
concerned.
> br,
> Aneeesh
Amicalement,
--
Albert.
next prev parent reply other threads:[~2012-06-23 9:01 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-05 17:47 [U-Boot] [PATCH] arm: enable unaligned access on ARMv7 Lucas Stach
2012-06-05 18:42 ` Stephen Warren
2012-06-05 19:06 ` Lucas Stach
2012-06-22 9:15 ` Albert ARIBAUD
2012-06-22 9:36 ` Lucas Stach
2012-06-22 11:16 ` Albert ARIBAUD
2012-06-22 11:47 ` Lucas Stach
2012-06-22 22:11 ` Aneesh V
2012-06-22 22:13 ` Aneesh V
2012-06-23 9:01 ` Albert ARIBAUD [this message]
2012-06-23 17:43 ` V, Aneesh
2012-06-25 20:34 ` Albert ARIBAUD
2012-06-25 21:49 ` Aneesh V
2012-06-25 22:02 ` Wolfgang Denk
2012-06-23 19:50 ` Måns Rullgård
2012-06-24 6:30 ` Lucas Stach
[not found] ` <20120625221741.3a32790e@lilith>
2012-06-25 21:34 ` Lucas Stach
2012-06-26 20:56 ` Rob Herring
2012-06-27 10:14 ` Tetsuyuki Kobayashi
2012-07-02 9:42 ` [U-Boot] [PATCH] arm: armv7: add compile option -mno-unaligned-access if available Tetsuyuki Kobayashi
2012-07-02 9:53 ` Måns Rullgård
2012-07-02 15:16 ` Lucas Stach
2012-07-02 16:14 ` Måns Rullgård
2012-07-03 7:10 ` Tetsuyuki Kobayashi
2012-07-05 7:57 ` Albert ARIBAUD
2012-07-18 21:37 ` Albert ARIBAUD
2012-07-19 4:31 ` Mike Frysinger
2012-07-19 4:29 ` Mike Frysinger
2012-07-19 6:28 ` Albert ARIBAUD
2012-07-19 14:27 ` Mike Frysinger
2012-07-20 7:12 ` Albert ARIBAUD
2012-07-12 15:12 ` Gary Thomas
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=20120623110113.511091c8@lilith \
--to=albert.u.boot@aribaud.net \
--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