Re: [U-Boot] [PATCH v4] USB: Add align(4) in __attribute__ ((packed)) for struct ehci_hccr and ehci_hcor

2011-08-26 Thread Wolfgang Denk
Dear Joel A Fernandes,

In message 1313097765-3206-1-git-send-email-agnel.j...@gmail.com you wrote:
 From: Jason Kridner jkrid...@beagleboard.org
 
 Switched to align(4) to prevent byte access to soc registers in some gcc 
 versions.
...
 -} __attribute__ ((packed));
 +} __attribute__ ((packed, aligned(4)));

Can we not rather get rid of this packed attribute alltogether?

I know there has been a long discussion around this on lak and lkml,
see for example here:

http://thread.gmane.org/gmane.linux.kernel/1132033/focus=120777

And like for example Arnd I feel that this patch is not a cleanup.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
It is easier to change the specification to fit the program than vice
versa.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v4] USB: Add align(4) in __attribute__ ((packed)) for struct ehci_hccr and ehci_hcor

2011-08-11 Thread Joel A Fernandes
From: Jason Kridner jkrid...@beagleboard.org

Switched to align(4) to prevent byte access to soc registers in some gcc 
versions.

Credits have to go to Laine Walker-Avina lwalk...@ieee.org for finding the 
problem.

Signed-off-by: Jason Kridner jkrid...@beagleboard.org
Signed-off-by: Joel A Fernandes agnel.j...@gmail.com
Cc: Koen Kooi k-k...@ti.com
Cc: Alexander Holler hol...@ahsoftware.de
Cc: Sandeep Paulraj s-paul...@ti.com
Cc: Igor Grinberg grinb...@compulab.co.il
---
Changes for v2:
* Original and v2 were provided by Alexander Holler.
* v1 was http://patchwork.ozlabs.org/patch/89358/
* v2 was http://patchwork.ozlabs.org/patch/89362/

Changes for v3:
* Switched to align(4), rather than remove the attribute, per suggestion
  from Alexander.

Changes for v4:
* Modified commit summary and title to be more accurate

 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..3d0ad0c 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));
+} __attribute__ ((packed, aligned(4)));
 
 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));
+} __attribute__ ((packed, aligned(4)));
 
 #define USBMODE0x68/* USB Device mode */
 #define USBMODE_SDIS   (1  3)/* Stream disable */
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot