Commit 5290759cc4008075fb9333b32b49d74b8b5c3258

Authored by Joel Fernandes
Committed by Marek Vasut
1 parent 6b40852da5

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 using DEFINE_CACHE_ALIGN_BUFFER.

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

Cc: Tom Rini <trini@ti.com>
Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Joel Fernandes <joelf@ti.com>

Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff

drivers/usb/gadget/ether.c
... ... @@ -849,9 +849,10 @@
849 849 };
850 850  
851 851 /*============================================================================*/
852   -static u8 control_req[USB_BUFSIZ];
  852 +DEFINE_CACHE_ALIGN_BUFFER(u8, control_req, USB_BUFSIZ);
  853 +
853 854 #if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
854   -static u8 status_req[STATUS_BYTECOUNT] __attribute__ ((aligned(4)));
  855 +DEFINE_CACHE_ALIGN_BUFFER(u8, status_req, STATUS_BYTECOUNT);
855 856 #endif
856 857  
857 858