From: Alexander Holler <holler@ahsoftware.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] USB: Remove __attribute__ ((packed)) for struct ehci_hccr and ehci_hcor.
Date: Sat, 02 Apr 2011 10:32:38 +0200 [thread overview]
Message-ID: <4D96DF26.6040408@ahsoftware.de> (raw)
In-Reply-To: <1301697344-4033-1-git-send-email-holler@ahsoftware.de>
Hello,
Am 02.04.2011 00:35, schrieb Alexander Holler:
> Remove __attribute__ ((packed)) to prevent byte access to soc
> registers in some gcc versions.
>
> Having patches to enable ehci for the BeagleBoard lying around for
> several month, this one was the show-stopper.
>
> Credits have to go to Laine Walker-Avina<lwalkera@ieee.org> for
> finding the problem.
>
> Signed-off-by: Alexander Holler<holler@ahsoftware.de>
> ---
> drivers/usb/host/ehci.h | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
> index 945ab64..df9f055 100644
> --- a/drivers/usb/host/ehci.h
> +++ b/drivers/usb/host/ehci.h
> @@ -55,7 +55,7 @@ struct ehci_hccr {
> #define HCS_N_PORTS(p) (((p)>> 0)& 0xf)
> uint32_t cr_hccparams;
> uint8_t cr_hcsp_portrt[8];
> -} __attribute__ ((packed));
> +};
>
> struct ehci_hcor {
> uint32_t or_usbcmd;
> @@ -85,7 +85,7 @@ struct ehci_hcor {
> #define FLAG_CF (1<< 0) /* true: we'll support "high speed" */
> uint32_t or_portsc[CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS];
> uint32_t or_systune;
> -} __attribute__ ((packed));
> +};
>
> #define USBMODE 0x68 /* USB Device mode */
> #define USBMODE_SDIS (1<< 3) /* Stream disable */
Before I'm killing someones 64bit+ machine with that patch:
The hint I've received was to use
+} __attribute__ ((packed, aligned(4)));
That works too. I haven't seen the original commit (I've only got told
that credits have to go to Laine Walker-Avina), I don't know if the
standard says something to that, I don't know if some 64bit+ SoC might
choose to align that stuff otherwise and I will not send a v2 of that patch.
Regards,
Alexander
next prev parent reply other threads:[~2011-04-02 8:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-01 22:35 [U-Boot] [PATCH] USB: Remove __attribute__ ((packed)) for struct ehci_hccr and ehci_hcor Alexander Holler
2011-04-01 22:53 ` Wolfgang Denk
2011-04-01 23:14 ` Alexander Holler
2011-04-01 23:35 ` Wolfgang Denk
2011-04-01 23:39 ` Alexander Holler
2011-04-02 8:32 ` Alexander Holler [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-04-01 22:13 Alexander Holler
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=4D96DF26.6040408@ahsoftware.de \
--to=holler@ahsoftware.de \
--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