From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 06/20] usb: gadget: config: fix unaligned access issues
Date: Fri, 2 Aug 2013 01:27:45 +0200 [thread overview]
Message-ID: <201308020127.45919.marex@denx.de> (raw)
In-Reply-To: <51FAEBC7.5090406@boundarydevices.com>
Dear Troy Kisky,
> On 8/1/2013 3:55 PM, Marek Vasut wrote:
> > Dear Troy Kisky,
> >
> >> On 8/1/2013 3:18 PM, Troy Kisky wrote:
> >>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> >>> ---
> >>>
> >>> drivers/usb/gadget/config.c | 6 ++++--
> >>> 1 file changed, 4 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/drivers/usb/gadget/config.c b/drivers/usb/gadget/config.c
> >>> index f563afe..014a679 100644
> >>> --- a/drivers/usb/gadget/config.c
> >>> +++ b/drivers/usb/gadget/config.c
> >>> @@ -10,6 +10,7 @@
> >>>
> >>> */
> >>>
> >>> #include <common.h>
> >>>
> >>> +#include <asm/unaligned.h>
> >>>
> >>> #include <asm/errno.h>
> >>> #include <linux/list.h>
> >>> #include <linux/string.h>
> >>>
> >>> @@ -86,7 +87,8 @@ int usb_gadget_config_buf(
> >>>
> >>> /* config descriptor first */
> >>> if (length < USB_DT_CONFIG_SIZE || !desc)
> >>>
> >>> return -EINVAL;
> >>>
> >>> - *cp = *config;
> >>> + /* config need not be aligned */
> >>> + memcpy(cp, config, sizeof(*cp));
> >>>
> >>> /* then interface/endpoint/class/vendor/... */
> >>> len = usb_descriptor_fillbuf(USB_DT_CONFIG_SIZE + (u8 *)buf,
> >>>
> >>> @@ -100,7 +102,7 @@ int usb_gadget_config_buf(
> >>>
> >>> /* patch up the config descriptor */
> >>> cp->bLength = USB_DT_CONFIG_SIZE;
> >>> cp->bDescriptorType = USB_DT_CONFIG;
> >>>
> >>> - cp->wTotalLength = cpu_to_le16(len);
> >>> + put_unaligned_le16(len, &cp->wTotalLength);
> >>>
> >>> cp->bmAttributes |= USB_CONFIG_ATT_ONE;
> >>> return len;
> >>>
> >>> }
> >>
> >> Sorry folks, I forgot to delete old patches when I rebased to put
> >> Stefano patches together, please ignore this one.
> >
> > Repost the series please, this is really hard to review.
> >
> > Best regards,
> > Marek Vasut
>
> Yes, will do a V3 to clear things up.
>
> Troy
Thanks a lot!
Best regards,
Marek Vasut
next prev parent reply other threads:[~2013-08-01 23:27 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-01 22:18 [U-Boot] [PATCH V2 00/20] Make mv_udc work for i.mx6 Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 01/20] Add functions for use with i.mx6 otg udc Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 02/20] mx6: iomux: add GPR1 defines Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 03/20] nitrogen6x: add otg usb ethernet gadget support Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 04/20] nitrogen6x: add CONFIG_MV_UDC Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 04/20] usb: gadget: mv_udc: fix hardware udc address for i.MX6 Troy Kisky
2013-08-01 22:41 ` Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 05/20] arch-mxs/sys_proto.h: include regs-common.h Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 05/20] nitrogen6x: add CONFIG_MV_UDC Troy Kisky
2013-08-01 22:45 ` Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 06/20] usb: gadget: config: fix unaligned access issues Troy Kisky
2013-08-01 22:47 ` Troy Kisky
2013-08-01 22:55 ` Marek Vasut
2013-08-01 23:14 ` Troy Kisky
2013-08-01 23:27 ` Marek Vasut [this message]
2013-08-01 22:18 ` [U-Boot] [PATCH V2 06/20] usb: gadget: mv_udc: fix hardware udc address for i.MX6 Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 07/20] arch-mxs/sys_proto.h: include regs-common.h Troy Kisky
2013-08-01 22:48 ` Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 07/20] usb: gadget: config: fix unaligned access issues Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 08/20] usb: gadget: mv_udc: add MX6Q specific reset Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 09/20] usb: gadget: ether set wMaxPacketSize Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 10/20] usb: gadget: ether: return error from rx_submit if no request Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 11/20] usb: gadget: mv_udc: split mv_udc.h file Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 12/20] usb: udc: add udc.h include file Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 13/20] usb: gadget: mv_udc: fix typo in error message Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 14/20] usb: gadget: mv_udc: set is_dualspeed = 1 Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 15/20] usb: gadget: mv_udc: fix full speed connections Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 16/20] usb: gadget: mv_udc: optimize bounce Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 17/20] usb: gadget: mv_udc: flush item before head Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 18/20] usb: gadget: mv_udc: optimize ep_enable Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 19/20] usb: gadget: mv_udc: zero transfer descriptor memory on probe Troy Kisky
2013-08-01 22:18 ` [U-Boot] [PATCH V2 20/20] usb: gadget: mv_udc: clear desc upon ep_disable Troy Kisky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201308020127.45919.marex@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox