Skip to contentSkip to conversation

usb: gadget: Fix data aborts during USB ethernet boot

PATCH Superseded Joel Fernandes 1 participant 1 message Sep 4, 2013 USB

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 usb: gadget: Fix data aborts during USB ethernet boot

As seen on GCC 4.6 Linaro compiler, control_req buffer is not aligned on 4 byte boundaray causing data aborts in eth_setup -> conf_buf during dhcp boot over usb_ether. Fix the issue my aligning control_req buffer to 4-byte boundary.

Tested on am335x_evm platform (beaglebone).
Applies on 2013.10-rc1 branch.

---
v2 changes:
- Using DEFINE_CACHE_ALIGN_BUFFER macro for the alignment.
- Also fixed alignment for status_req.

 drivers/usb/gadget/ether.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/usb/gadget/ether.c +3 -2
index 579893c..700d5fb 100644
@@ -849,9 +849,10 @@ static struct usb_gadget_strings	stringtab = {
 };
 
 /*============================================================================*/
-static u8 control_req[USB_BUFSIZ];
+DEFINE_CACHE_ALIGN_BUFFER(u8, control_req, USB_BUFSIZ);
+
 #if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
-static u8 status_req[STATUS_BYTECOUNT] __attribute__ ((aligned(4)));
+DEFINE_CACHE_ALIGN_BUFFER(u8, status_req, STATUS_BYTECOUNT);
 #endif
 
 
Signature · 1 line
1.8.1.2