[U-Boot] [PATCH v2 1/1] USB: Use (get|put)_unaligned for accessing wMaxPacketSize

Remy Bohmer linux at bohmer.net
Fri Dec 16 21:33:07 CET 2011


Hi All,

2011/12/15 Tom Rini <trini at ti.com>:
> In 9792987721c7980453fe6447c3fa6593b44f8458 Stefan describes a usecase
> where the previous behavior of leaving wMaxPacketSize be unaligned
> caused fatal problems.  The initial fix for this problem was incomplete
> however as it showed another cases of non-aligned access that previously
> worked implicitly.  This switches to making sure that all access of
> wMaxPacketSize are done via (get|put)_unaligned.
>
> In order to maintain a level of readability to the code in some cases
> we now use a variable for the value of wMaxPacketSize and in others, a
> macro.
>
> Cc: Minkyu Kang <mk7.kang at samsung.com>
> Cc: Remy Bohmer <linux at bohmer.net>
>
> OpenRISC:
> Tested-by: Stefan Kristiansson <stefan.kristiansson at saunalahti.fi>
>
> Beagleboard xM, Pandaboard run-tested, s5p_goni build-tested.
> Signed-off-by: Tom Rini <trini at ti.com>
> ---
>  common/cmd_usb.c                 |    3 ++-
>  common/usb.c                     |   27 +++++++++++++++++++--------
>  drivers/serial/usbtty.c          |   10 ++++++----
>  drivers/usb/gadget/epautoconf.c  |    8 +++++---
>  drivers/usb/gadget/s3c_udc_otg.c |   10 ++++++----
>  include/usbdescriptors.h         |    2 +-
>  6 files changed, 39 insertions(+), 21 deletions(-)

This patch looks good to me, so I applied it to u-boot-usb.
Since it seems to fix a pending regression, I will push out a pull
request to Wolfgang quickly.

Thanks.

Kind regards,

Remy


More information about the U-Boot mailing list