From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] USB:host: Attribute packed removed from usb structures
Date: Mon, 27 Feb 2012 19:56:20 -0500 [thread overview]
Message-ID: <201202271956.23159.vapier@gentoo.org> (raw)
In-Reply-To: <201202272153.29932.marek.vasut@gmail.com>
On Monday 27 February 2012 15:53:29 Marek Vasut wrote:
> > On Monday 27 February 2012 08:14:26 Marek Vasut wrote:
> > > > On 2/25/2012 3:42 PM, Albert ARIBAUD wrote:
> > > > > Le 24/02/2012 12:58, Amit Virdi a ?crit :
> > > > >> Packed attribute is forcing a bytewise write on device registers,
> > > > >> there by, resulting in a misbehavior on gcc-4.4.1.
> > > > >> Reverting the structures to non-packed
> > > > >
> > > > > If (just asking, not asserting) the issue is caused by fields being
> > > > > u8 where u8 access is not possible, then should you not make the
> > > > > fields u16 / u32 according to access requirements?
> > > >
> > > > The problem is not with the fields being of a different width. AFAIK,
> > > > the packed attribute changes the generated code to access even the
> > > > word field elements in a byte by byte manner
> > > >
> > > > Infact, there is a discussion on lkml that I can point
> > > > https://lkml.org/lkml/2011/4/27/278
> > > >
> > > > It seems that the discussion did not lead to a conclusion but it was
> > > > sensible (at least for ARM) to remove the packed attribute from this
> > > > structure
> > >
> > > What does the USB spec say ? It might be a HW bug?
> >
> > it isn't covered by the USB spec. these are structs for hardware
> > registers in the EHCI usb host controller.
>
> I see ... so replacing them with unions of accessors where it colides might
> work ?
i'm not entirely sure what you're asking, but i think you're pointing to the
right answer: drivers/usb/host/ehci.h:ehci_{read,write}l() should *not* be
casting/derferencing the pointers directly. they should instead be using
standard {read,write}l() funcs from asm/io.h.
Amit: can you post a new patch that does that instead ? don't touch the
packed attribute, but change ehci_readl() to use readl() and ehci_writel() to
use writel() ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120227/79bb511a/attachment.pgp>
next prev parent reply other threads:[~2012-02-28 0:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-24 11:58 [U-Boot] [PATCH] USB:host: Attribute packed removed from usb structures Amit Virdi
2012-02-24 19:18 ` Mike Frysinger
2012-02-27 10:02 ` Amit Virdi
2012-02-27 18:25 ` Mike Frysinger
2012-02-25 10:12 ` Albert ARIBAUD
2012-02-27 7:16 ` Vipin Kumar
2012-02-27 13:14 ` Marek Vasut
2012-02-27 18:26 ` Mike Frysinger
2012-02-27 20:53 ` Marek Vasut
2012-02-28 0:56 ` Mike Frysinger [this message]
2012-02-29 10:25 ` Amit Virdi
2012-03-06 12:06 ` Amit Virdi
2012-03-06 12:51 ` Marek Vasut
2012-03-07 8:30 ` Amit Virdi
2012-03-07 11:38 ` Marek Vasut
2012-03-07 12:12 ` Amit Virdi
2012-03-06 16:11 ` Mike Frysinger
2012-03-07 8:23 ` Amit Virdi
2012-03-07 13:33 ` Mike Frysinger
2012-03-07 13:49 ` Amit Virdi
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=201202271956.23159.vapier@gentoo.org \
--to=vapier@gentoo.org \
--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