From f903a20d1fc0e99741da671095c6b9ac7c13c7ae Mon Sep 17 00:00:00 2001 From: Vivek Gautam Date: Mon, 13 May 2013 15:53:37 +0530 Subject: [PATCH] usb: Use get_unaligned() in usb_endpoint_maxp() for wMaxPacketSize Use unaligned access to fetch wMaxPacketSize in usb_endpoint_maxp() api. In its absence we see following data abort message: ============================================================== data abort MAYBE you should read doc/README.arm-unaligned-accesses pc : [] lr : [] sp : bf37c7b0 ip : 0000002f fp : 00000000 r10: 00000000 r9 : 00000002 r8 : bf37fecc r7 : 00000001 r6 : bf7d8931 r5 : bf7d891c r4 : bf7d8800 r3 : bf7d65b0 r2 : 00000002 r1 : bf7d65b4 r0 : 00000027 Flags: nZCv IRQs off FIQs off Mode SVC_32 Resetting CPU ... resetting ... ============================================================== Signed-off-by: Vivek Gautam Cc: Ilya Yanok Cc: Marek Vasut --- include/linux/usb/ch9.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index d1d732c..bd48704 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h @@ -35,6 +35,7 @@ #include /* __u8 etc */ #include /* le16_to_cpu */ +#include /* get_unaligned() */ /*-------------------------------------------------------------------------*/ @@ -596,7 +597,7 @@ static inline int usb_endpoint_is_isoc_out( */ static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd) { - return __le16_to_cpu(epd->wMaxPacketSize); + return __le16_to_cpu(get_unaligned(&epd->wMaxPacketSize)); } static inline int usb_endpoint_interrupt_type(