summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2013-06-27 10:04:57 +0200
committerMarek Vasut <marex@denx.de>2013-06-30 18:41:08 +0200
commitb37c4a2baabc61450bb9f8bd16b233a25315c816 (patch)
tree769e682eecfcbb34732a74fb6846c12cfd464444 /include/linux
parente059a400ad780328cd5ad22c396298cac520c856 (diff)
downloadu-boot-imx-b37c4a2baabc61450bb9f8bd16b233a25315c816.zip
u-boot-imx-b37c4a2baabc61450bb9f8bd16b233a25315c816.tar.gz
u-boot-imx-b37c4a2baabc61450bb9f8bd16b233a25315c816.tar.bz2
usb: fix unaligned access in device_qual()
while playing with dfu, I tapped in an unaligned access when doing on the host side a "lsusb -d [vendornr]: -v" I get on the board: GADGET DRIVER: usb_dnl_dfu data abort MAYBE you should read doc/README.arm-unaligned-accesses pc : [<8ff71db8>] lr : [<8ff75aec>] sp : 8ef40d18 ip : 00000005 fp : 00000000 r10: 00000000 r9 : 47401410 r8 : 8ef40f38 r7 : 8ef4aae8 r6 : 0000000a r5 : 8ef4ab28 r4 : 8ef4ab80 r3 : 0000000a r2 : 00000006 r1 : 00000006 r0 : 8ef4aae8 Flags: Nzcv IRQs off FIQs on Mode SVC_32 Resetting CPU ... reason is that in the "struct usb_composite_dev" the "struct usb_device_descriptor desc;" is on an odd address, and this struct gets accessed in drivers/usb/gadget/composite.c device_qual() Fix it, by align this var "struct desc" fix to an aligned address. Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Samuel Egli <samuel.egli@siemens.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/usb/composite.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 53cb095..4f76f88 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -331,7 +331,7 @@ struct usb_composite_dev {
/* private: */
/* internals */
unsigned int suspended:1;
- struct usb_device_descriptor desc;
+ struct usb_device_descriptor __aligned(CONFIG_SYS_CACHELINE_SIZE) desc;
struct list_head configs;
struct usb_composite_driver *driver;
u8 next_string_id;