All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] usb: Use get_unaligned() in usb_endpoint_maxp() for wMaxPacketSize
@ 2013-05-13 10:23 Vivek Gautam
  2013-05-13 10:23 ` [U-Boot] [PATCH 2/2] usb: gadget: Use unaligned access " Vivek Gautam
  0 siblings, 1 reply; 8+ messages in thread
From: Vivek Gautam @ 2013-05-13 10:23 UTC (permalink / raw)
  To: u-boot

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 : [<bf794e24>]          lr : [<bf794e1c>]
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 <gautam.vivek@samsung.com>
Cc: Ilya Yanok <ilya.yanok@cogentembedded.com>
Cc: Marek Vasut <marex@denx.de>
---

Based on u-boot-usb/next. Tested with 'u-boot-usb/master' branch.

 include/linux/usb/ch9.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

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 <linux/types.h>	/* __u8 etc */
 #include <asm/byteorder.h>	/* le16_to_cpu */
+#include <asm/unaligned.h>	/* 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(
-- 
1.7.6.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-05-14 13:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-13 10:23 [U-Boot] [PATCH 1/2] usb: Use get_unaligned() in usb_endpoint_maxp() for wMaxPacketSize Vivek Gautam
2013-05-13 10:23 ` [U-Boot] [PATCH 2/2] usb: gadget: Use unaligned access " Vivek Gautam
2013-05-13 10:50   ` Kyungmin Park
2013-05-13 11:46     ` Vivek Gautam
2013-05-13 11:56     ` Albert ARIBAUD
2013-05-13 12:03   ` Łukasz Dałek
2013-05-14 13:37   ` Piotr Wilczek
2013-05-14 13:49   ` Marek Vasut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.