* [U-Boot] [PATCH v3] usb: gadget: Fix data aborts during USB ethernet boot
@ 2013-09-04 23:55 Joel Fernandes
2013-09-05 1:31 ` Bo Shen
2013-09-05 15:02 ` Marek Vasut
0 siblings, 2 replies; 4+ messages in thread
From: Joel Fernandes @ 2013-09-04 23:55 UTC (permalink / raw)
To: u-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>
---
v2 changes:
- Using DEFINE_CACHE_ALIGN_BUFFER macro for the alignment.
- Also fixed alignment for status_req.
v3 changes:
- Adjusted commit message for v2 change.
drivers/usb/gadget/ether.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 579893c..700d5fb 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -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
--
1.8.1.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v3] usb: gadget: Fix data aborts during USB ethernet boot
2013-09-04 23:55 [U-Boot] [PATCH v3] usb: gadget: Fix data aborts during USB ethernet boot Joel Fernandes
@ 2013-09-05 1:31 ` Bo Shen
2013-09-05 13:46 ` Marek Vasut
2013-09-05 15:02 ` Marek Vasut
1 sibling, 1 reply; 4+ messages in thread
From: Bo Shen @ 2013-09-05 1:31 UTC (permalink / raw)
To: u-boot
Hi Joel Fernandes,
On 09/05/2013 07:55 AM, Joel Fernandes wrote:
> 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>
> ---
> v2 changes:
> - Using DEFINE_CACHE_ALIGN_BUFFER macro for the alignment.
> - Also fixed alignment for status_req.
>
> v3 changes:
> - Adjusted commit message for v2 change.
>
> drivers/usb/gadget/ether.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Test on sama5d3xek board with RNDIS gadget, it still has the unaligned
access issue.
However, I test with this patch "usb: gadget: config: fix unaligned
access issues" from: Troy Kisky <troy.kisky@boundarydevices.com> really
fix the unaligned access issue.
more information at: http://patchwork.ozlabs.org/patch/264151/
> diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
> index 579893c..700d5fb 100644
> --- a/drivers/usb/gadget/ether.c
> +++ b/drivers/usb/gadget/ether.c
> @@ -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
Best Regards,
Bo Shen
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v3] usb: gadget: Fix data aborts during USB ethernet boot
2013-09-05 1:31 ` Bo Shen
@ 2013-09-05 13:46 ` Marek Vasut
0 siblings, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2013-09-05 13:46 UTC (permalink / raw)
To: u-boot
Dear Bo Shen,
> Hi Joel Fernandes,
>
> On 09/05/2013 07:55 AM, Joel Fernandes wrote:
> > 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>
> > ---
> >
> > v2 changes:
> > - Using DEFINE_CACHE_ALIGN_BUFFER macro for the alignment.
> > - Also fixed alignment for status_req.
> >
> > v3 changes:
> > - Adjusted commit message for v2 change.
> >
> > drivers/usb/gadget/ether.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
>
> Test on sama5d3xek board with RNDIS gadget, it still has the unaligned
> access issue.
>
> However, I test with this patch "usb: gadget: config: fix unaligned
> access issues" from: Troy Kisky <troy.kisky@boundarydevices.com> really
> fix the unaligned access issue.
>
> more information at: http://patchwork.ozlabs.org/patch/264151/
Troy, care to fix up the patch's commit log so I can try and understand it?
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v3] usb: gadget: Fix data aborts during USB ethernet boot
2013-09-04 23:55 [U-Boot] [PATCH v3] usb: gadget: Fix data aborts during USB ethernet boot Joel Fernandes
2013-09-05 1:31 ` Bo Shen
@ 2013-09-05 15:02 ` Marek Vasut
1 sibling, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2013-09-05 15:02 UTC (permalink / raw)
To: u-boot
Dear Joel Fernandes,
> 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>
> ---
> v2 changes:
> - Using DEFINE_CACHE_ALIGN_BUFFER macro for the alignment.
> - Also fixed alignment for status_req.
>
> v3 changes:
> - Adjusted commit message for v2 change.
>
> drivers/usb/gadget/ether.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
> index 579893c..700d5fb 100644
> --- a/drivers/usb/gadget/ether.c
> +++ b/drivers/usb/gadget/ether.c
> @@ -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
Applied, thanks
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-09-05 15:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-04 23:55 [U-Boot] [PATCH v3] usb: gadget: Fix data aborts during USB ethernet boot Joel Fernandes
2013-09-05 1:31 ` Bo Shen
2013-09-05 13:46 ` Marek Vasut
2013-09-05 15:02 ` Marek Vasut
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox